summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2011-07-25 16:40:11 +0200
committerMarcel Hellkamp <marc@gsites.de>2011-07-27 21:40:11 +0200
commit2ac17828c0a8face5548d4b3474ca8450ea89a7c (patch)
tree0892bfc1176ffd4c62e8abb936a3d45090bc0ebf
parent351f22a541c22fc1ff08eb9229ed0aeac3d30223 (diff)
downloadbottle-2ac17828c0a8face5548d4b3474ca8450ea89a7c.tar.gz
fix: Workaround for a bug in some versions of lib2to3 (fix #175)
-rwxr-xr-xbottle.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index 8f6e7b6..04472b1 100755
--- a/bottle.py
+++ b/bottle.py
@@ -40,9 +40,14 @@ import warnings
from Cookie import SimpleCookie
from tempfile import TemporaryFile
from traceback import format_exc
-from urllib import urlencode, quote as urlquote, unquote as urlunquote
from urlparse import urlunsplit, urljoin, SplitResult as UrlSplitResult
+# Workaround for a bug in some versions of lib2to3 (fixed on CPython 2.7 and 3.2)
+import urllib
+urlencode = urllib.urlencode
+urlquote = urllib.quote
+urlunquote = urllib.unquote
+
try: from collections import MutableMapping as DictMixin
except ImportError: # pragma: no cover
from UserDict import DictMixin