summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-27 20:02:24 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-27 20:02:24 -0400
commit2709ae46884f405d95dc16be0667a6cbbebcfb69 (patch)
treec5849c0c362552384a25c50621e193f2a213dc32 /lib/sqlalchemy/util
parent4b614b9b35cd2baddb7ca67c04bee5d70ec6a172 (diff)
downloadsqlalchemy-2709ae46884f405d95dc16be0667a6cbbebcfb69.tar.gz
work through dialects
Diffstat (limited to 'lib/sqlalchemy/util')
-rw-r--r--lib/sqlalchemy/util/__init__.py2
-rw-r--r--lib/sqlalchemy/util/compat.py33
2 files changed, 17 insertions, 18 deletions
diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py
index 3fa06c793..2fcfabefd 100644
--- a/lib/sqlalchemy/util/__init__.py
+++ b/lib/sqlalchemy/util/__init__.py
@@ -7,7 +7,7 @@
from .compat import callable, cmp, reduce, \
threading, py3k, py3k_warning, jython, pypy, cpython, win32, set_types, \
pickle, dottedgetter, parse_qsl, namedtuple, next, WeakSet, reraise, \
- raise_from_cause
+ raise_from_cause, text_type, string_type, binary_type, quote_plus
from ._collections import KeyedTuple, ImmutableContainer, immutabledict, \
Properties, OrderedProperties, ImmutableProperties, OrderedDict, \
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 !