From 5c86d3914cb2ddb3333f47e35f5fe7a34bca882b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 15 Dec 2011 10:31:55 -0500 Subject: - [bug] Fixed inappropriate usage of util.py3k flag and renamed it to util.py3k_warning, since this flag is intended to detect the -3 flag series of import restrictions only. [ticket:2348] --- lib/sqlalchemy/util/compat.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/sqlalchemy/util/compat.py') diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index 380e3a9a5..18549c8b9 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -18,12 +18,12 @@ except ImportError: import dummy_threading as threading py32 = sys.version_info >= (3, 2) -py3k = getattr(sys, 'py3kwarning', False) or sys.version_info >= (3, 0) +py3k_warning = getattr(sys, 'py3kwarning', False) or sys.version_info >= (3, 0) jython = sys.platform.startswith('java') pypy = hasattr(sys, 'pypy_version_info') win32 = sys.platform.startswith('win') -if py3k: +if py3k_warning: set_types = set elif sys.version_info < (2, 6): import sets @@ -43,7 +43,7 @@ else: set_types = set, sets.Set -if py3k: +if py3k_warning: import pickle else: try: @@ -89,12 +89,13 @@ if sys.version_info < (2, 6): else: from urlparse import parse_qsl -if py3k: - from inspect import getfullargspec as inspect_getfullargspec -else: - from inspect import getargspec as inspect_getfullargspec +# Py3K +#from inspect import getfullargspec as inspect_getfullargspec +# Py2K +from inspect import getargspec as inspect_getfullargspec +# end Py2K -if py3k: +if py3k_warning: # they're bringing it back in 3.2. brilliant ! def callable(fn): return hasattr(fn, '__call__') -- cgit v1.2.1