Naereen/fontify

BUG: StringIO support in python3

Closed this issue · 1 comments

In hello.py, line 12, it should be

try:
    from StringIO import StringIO
except ImportError:  # in Python 3
    from io import StringIO  # this line

instead of from io.StringIO import StringIO which doesn't work in python3:

➜  fontify git:(python3) ipython
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:53:17) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from io.StringIO import StringIO                                                            
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-156f63a5e131> in <module>
----> 1 from io.StringIO import StringIO

ModuleNotFoundError: No module named 'io.StringIO'; 'io' is not a package

Hi @mathurinm, thanks, it's now fixed as you suggested.
(Tip: next time, directly submit a pull request!)