Mercurial > code > home > repos > light9
diff lib/ipython_view.py @ 1866:3c523c71da29
pyflakes cleanups and some refactors
Ignore-this: f7372e678699175feb4e628eee3d768c
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 25 May 2019 12:10:51 +0000 |
parents | 547d65ea9902 |
children |
line wrap: on
line diff
--- a/lib/ipython_view.py Sat May 25 12:06:01 2019 +0000 +++ b/lib/ipython_view.py Sat May 25 12:10:51 2019 +0000 @@ -21,11 +21,12 @@ import sys import os from gi.repository import Pango -from StringIO import StringIO +from io import StringIO +from functools import reduce try: - import IPython -except Exception,e: + import IPython +except Exception as e: raise "Error importing IPython (%s)" % str(e) ansi_colors = {'0;30': 'Black', @@ -148,11 +149,11 @@ def shell(self, cmd,verbose=0,debug=0,header=''): stat = 0 - if verbose or debug: print header+cmd + if verbose or debug: print(header+cmd) # flush stdout so we don't mangle python's buffering if not debug: input, output = os.popen4(cmd) - print output.read() + print(output.read()) output.close() input.close()