mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
'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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user