diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-27 20:02:24 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-27 20:02:24 -0400 |
commit | 2709ae46884f405d95dc16be0667a6cbbebcfb69 (patch) | |
tree | c5849c0c362552384a25c50621e193f2a213dc32 /lib/sqlalchemy/util/compat.py | |
parent | 4b614b9b35cd2baddb7ca67c04bee5d70ec6a172 (diff) | |
download | sqlalchemy-2709ae46884f405d95dc16be0667a6cbbebcfb69.tar.gz |
work through dialects
Diffstat (limited to 'lib/sqlalchemy/util/compat.py')
-rw-r--r-- | lib/sqlalchemy/util/compat.py | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index 4eb915469..d00e3ab23 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -21,11 +21,8 @@ pypy = hasattr(sys, 'pypy_version_info') win32 = sys.platform.startswith('win') cpython = not pypy and not jython # TODO: something better for this ? -if py3k_warning: +if py3k: set_types = set -elif sys.version_info < (2, 6): - import sets - set_types = set, sets.Set else: # 2.6 deprecates sets.Set, but we still need to be able to detect them # in user code and as return values from DB-APIs @@ -46,7 +43,7 @@ if sys.version_info < (2, 6): return iter.__next__() else: next = next -if py3k_warning: +if py3k: import pickle else: try: @@ -54,19 +51,21 @@ else: except ImportError: import pickle -if sys.version_info < (2, 6): - # emits a nasty deprecation warning - # in newer pythons - from cgi import parse_qsl +from urllib.parse import parse_qsl + + +if py3k: + from inspect import getfullargspec as inspect_getfullargspec + from urllib.parse import quote_plus, unquote_plus + string_types = str, + binary_type = bytes + text_type = str else: - from urllib.parse import parse_qsl - -# start Py3K -from inspect import getfullargspec as inspect_getfullargspec -# end Py3K -# start Py2K -#from inspect import getargspec as inspect_getfullargspec -# end Py2K + from inspect import getargspec as inspect_getfullargspec + from urllib import quote_plus, unquote_plus + string_types = basestring, + binary_type = str + text_type = unicode if py3k_warning: # they're bringing it back in 3.2. brilliant ! |