-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify python version check such that linters recognize it #2039
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,7 @@ | |
if not hasattr(sys.modules[__name__], "__file__"): | ||
__file__ = inspect.getfile(inspect.currentframe()) | ||
|
||
_python2 = sys.version_info[0] < 3 | ||
if _python2: | ||
if sys.version_info < (3,): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This piece of code is redundant altogether. Python 3 never gets here anyway. |
||
range = xrange | ||
|
||
_lib = { 'darwin': 'libunicorn.2.dylib', | ||
|
@@ -55,7 +54,7 @@ def _load_win_support(path): | |
ctypes.cdll.LoadLibrary(lib_file) | ||
#print('SUCCESS') | ||
_loaded_windows_dlls.add(dll) | ||
except OSError as e: | ||
except OSError: | ||
#print('FAIL to load %s' %lib_file, e) | ||
continue | ||
|
||
|
@@ -72,7 +71,7 @@ def _load_lib(path): | |
dll = ctypes.cdll.LoadLibrary(lib_file) | ||
#print('SUCCESS') | ||
return dll | ||
except OSError as e: | ||
except OSError: | ||
#print('FAIL to load %s' %lib_file, e) | ||
return None | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from unicorn.x86_const import * | ||
|
||
|
||
if sys.version_info.major == 2: | ||
if sys.version_info < (3,): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned above, this is less readable when comparing major version only. |
||
range = xrange | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could make sense if we were differentiating between different minor versions, but only comparing for major version this is less readable.