diff options
author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:49:12 +0100 |
---|---|---|
committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:49:12 +0100 |
commit | 674ae7718bc06a8b8c8b658075bf82c8198fb632 (patch) | |
tree | 0075bace24ead7f03ae7cb18935e4c707f71a860 /paste/wsgilib.py | |
parent | 3cdb7e4227cbaad690b1c1557c03fa6da0decc36 (diff) | |
download | paste-674ae7718bc06a8b8c8b658075bf82c8198fb632.tar.gz |
Python 3: use new names of standard library modules
Use "try/except ImportError" to try Python 2 and Python 3 names.
Diffstat (limited to 'paste/wsgilib.py')
-rw-r--r-- | paste/wsgilib.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/paste/wsgilib.py b/paste/wsgilib.py index 67ced97..a44bc9d 100644 --- a/paste/wsgilib.py +++ b/paste/wsgilib.py @@ -13,10 +13,9 @@ from paste.response import HeaderDict, has_header, header_value, remove_header from paste.response import error_body_response, error_response, error_response_app from traceback import print_exception -import urllib -from cStringIO import StringIO import sys -from urlparse import urlsplit +from six.moves import cStringIO as StringIO +from six.moves.urllib.parse import unquote, urlsplit import warnings __all__ = ['add_close', 'add_start_close', 'capture_output', 'catch_errors', @@ -303,7 +302,7 @@ def raw_interactive(application, path='', raise_on_wsgi_error=False, } if path: (_, _, path_info, query, fragment) = urlsplit(str(path)) - path_info = urllib.unquote(path_info) + path_info = unquote(path_info) # urlsplit returns unicode so coerce it back to str path_info, query = str(path_info), str(query) basic_environ['PATH_INFO'] = path_info |