kislyuk / eight

Python 2 to the power of 3
https://eight.readthedocs.org/
Apache License 2.0
47 stars 6 forks source link

Fix UnboundLocalError on decode_command_line_args on Python 3 #8

Closed conradoplg closed 7 years ago

conradoplg commented 7 years ago

On Python 3, decode_command_line_args gives an error:

Traceback (most recent call last):
  ...
  File ".env3/lib/python3.5/site-packages/eight/__init__.py", line 113, in decode_command_line_args
    return sys.argv
UnboundLocalError: local variable 'sys' referenced before assignment

This PR fixes it by importing sys outside the if.

codecov-io commented 7 years ago

Codecov Report

Merging #8 into master will increase coverage by 5.71%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage      80%   85.71%   +5.71%     
==========================================
  Files           2        2              
  Lines         140      140              
==========================================
+ Hits          112      120       +8     
+ Misses         28       20       -8
Impacted Files Coverage Δ
eight/__init__.py 89.52% <100%> (+7.61%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5e48f1b...e5740b4. Read the comment docs.

kislyuk commented 7 years ago

Thanks for catching the bug.

kislyuk commented 7 years ago

Released in v0.4.2.