diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-06-21 18:34:14 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-06-21 18:34:14 -0400 |
commit | 7173d11ba2ad2275951c973a784b9f28396dea90 (patch) | |
tree | 6358b3b5d2c771ae86e39637534144e256a87a86 /lib/sqlalchemy/engine/url.py | |
parent | cf7453e0019194256731a4cb10df50ac4256582f (diff) | |
download | sqlalchemy-7173d11ba2ad2275951c973a784b9f28396dea90.tar.gz |
- Use urllib.parse_qsl() in Python 2.6 and above,
no deprecation warning about cgi.parse_qsl()
[ticket:1682]
Diffstat (limited to 'lib/sqlalchemy/engine/url.py')
-rw-r--r-- | lib/sqlalchemy/engine/url.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index 7d5e0692f..0734f6035 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -12,8 +12,8 @@ with a string argument; alternatively, the URL is a public-facing construct whic be used directly and is also accepted directly by ``create_engine()``. """ -import re, cgi, sys, urllib -from sqlalchemy import exc +import re, urllib +from sqlalchemy import exc, util class URL(object): @@ -193,7 +193,7 @@ def _parse_rfc1738_args(name): if components['database'] is not None: tokens = components['database'].split('?', 2) components['database'] = tokens[0] - query = (len(tokens) > 1 and dict(cgi.parse_qsl(tokens[1]))) or None + query = (len(tokens) > 1 and dict(util.parse_qsl(tokens[1]))) or None # Py2K if query is not None: query = dict((k.encode('ascii'), query[k]) for k in query) @@ -215,7 +215,7 @@ def _parse_keyvalue_args(name): m = re.match( r'(\w+)://(.*)', name) if m is not None: (name, args) = m.group(1, 2) - opts = dict( cgi.parse_qsl( args ) ) + opts = dict( util.parse_qsl( args ) ) return URL(name, *opts) else: return None |