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/wsgiwrappers.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/wsgiwrappers.py')
-rw-r--r-- | paste/wsgiwrappers.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/paste/wsgiwrappers.py b/paste/wsgiwrappers.py index 7821d26..7074923 100644 --- a/paste/wsgiwrappers.py +++ b/paste/wsgiwrappers.py @@ -8,7 +8,13 @@ to deal with an incoming request and sending a response. import re import warnings from pprint import pformat -from Cookie import SimpleCookie +try: + # Python 3 + from http.cookies import SimpleCookie +except ImportError: + # Python 2 + from Cookie import SimpleCookie + from paste.request import EnvironHeaders, get_cookie_dict, \ parse_dict_querystring, parse_formvars from paste.util.multidict import MultiDict, UnicodeMultiDict |