]> git.wh0rd.org Git - home.git/commitdiff
ipython: support py3 a bit better
authorMike Frysinger <vapier@gentoo.org>
Thu, 16 Jul 2015 04:10:42 +0000 (00:10 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 16 Jul 2015 04:10:42 +0000 (00:10 -0400)
.ipython/profile_default/startup/50-dump.py

index 565c5445ed25e754e3d3167b79f1240dbd7a8b6e..e1910eae62059286bf136ff198338a8db967d73f 100644 (file)
@@ -9,7 +9,10 @@ from __future__ import print_function
 
 class Dump(object):
 
-    import cStringIO
+    try:
+        from cStringIO import StringIO
+    except:
+        from io import StringIO
     import datetime
     import logging
     import pydoc
@@ -81,7 +84,7 @@ class Dump(object):
     def __init__(self, obj, depth=None, out=None, linelim=150,
                  show_internal=False, show_all=False, show_std=False):
         if out is None:
-            out = self.cStringIO.StringIO()
+            out = self.StringIO()
             #out = self.sys.stdout
         self.out = out