Psycojoker / ipython-beautifulsoup

Pretty HTML/XML rendering with syntax highlighting for BeautifulSoup objects in IPython notebook and qtconsole.
68 stars 11 forks source link

Python 3 support? #4

Closed MattDMo closed 10 years ago

MattDMo commented 10 years ago

Are there any plans to make this Python 3 compatible? I just quickly scanned through soup.py, and the only incompatibility I saw was the use of urllib2, which is Python 2-only. Changing

from urllib2 import urlopen

to

try:
    from urllib2 import urlopen
except ImportError:
    from urllib.request import urlopen

should do the trick. I'll submit a pull request if you're interested.

Psycojoker commented 10 years ago

I'm closing this since you have provided the said PR (which much more). https://github.com/Psycojoker/ipython-beautifulsoup/pull/5

Thanks again :)