From 15b1f4b1617cf2c0f2bb5bbe8f988c0f82068a0d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 14 Apr 2013 14:40:51 -0400 Subject: [PATCH] Add Python 2.x compatibility for urllib's urlencode --- ipythonirc/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.26.2