From: W. Trevor King Date: Sun, 14 Apr 2013 18:40:51 +0000 (-0400) Subject: Add Python 2.x compatibility for urllib's urlencode X-Git-Tag: v0.3~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=15b1f4b1617cf2c0f2bb5bbe8f988c0f82068a0d;p=ipython-irc.git Add Python 2.x compatibility for urllib's urlencode --- diff --git a/ipythonirc/__init__.py b/ipythonirc/__init__.py index e49b042..297d8c8 100644 --- a/ipythonirc/__init__.py +++ b/ipythonirc/__init__.py @@ -18,7 +18,10 @@ """An IRC iframe using webchat.freenode.net """ -import urllib.parse as _urllib_parse +try: # Python 3.x + import urllib.parse as _urllib_parse +except ImportError: # Python 2.x + import urllib as _urllib_parse # for urlencode import IPython.display as _IPython_display