'hasattr' function on '__builtins__' for 'xrange' function does not
return correct information from a script, but works well on interactive shell. Used a more proper check for Python > 2 instead of the current implementation. Thanks Vishal for the report.pull/3/head
parent
6fa4065eee
commit
1ada5031cd
|
|
@ -33,7 +33,7 @@ import config
|
|||
# If script is running under python3, it will not have the xrange function
|
||||
# defined
|
||||
winreg = None
|
||||
if not hasattr(__builtins__, 'xrange'):
|
||||
if sys.version_info.major >= 3:
|
||||
xrange = range
|
||||
if os.name == 'nt':
|
||||
import winreg
|
||||
|
|
|
|||
Loading…
Reference in New Issue