summaryrefslogtreecommitdiff
path: root/pecan/compat
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2013-05-03 12:07:50 -0400
committerRyan Petrello <lists@ryanpetrello.com>2013-05-03 12:07:50 -0400
commit81b13c4144c636b956fac2b826b1ebf08a404641 (patch)
treed862776882114e6cf4c6bed8899b79c843a013ad /pecan/compat
parent2edea4258995038a7c4b238cb65ece68ff810528 (diff)
downloadpecan-81b13c4144c636b956fac2b826b1ebf08a404641.tar.gz
General import and flake8 cleanup.
Diffstat (limited to 'pecan/compat')
-rw-r--r--pecan/compat/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pecan/compat/__init__.py b/pecan/compat/__init__.py
index 02a0631..93883f4 100644
--- a/pecan/compat/__init__.py
+++ b/pecan/compat/__init__.py
@@ -2,6 +2,17 @@ import inspect
import six
+if six.PY3:
+ import urllib.parse as urlparse
+ from urllib.parse import quote, unquote_plus
+ from urllib.request import urlopen, URLError
+ from html import escape
+else:
+ import urlparse # noqa
+ from urllib import quote, unquote_plus # noqa
+ from urllib2 import urlopen, URLError # noqa
+ from cgi import escape # noqa
+
def is_bound_method(ob):
return inspect.ismethod(ob) and six.get_method_self(ob) is not None