From: Mike Frysinger Date: Thu, 16 Jul 2015 04:10:42 +0000 (-0400) Subject: ipython: support py3 a bit better X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=722f573c3c8e18abc7d0d5543fe66e2272636f83;p=home.git ipython: support py3 a bit better --- diff --git a/.ipython/profile_default/startup/50-dump.py b/.ipython/profile_default/startup/50-dump.py index 565c544..e1910ea 100644 --- a/.ipython/profile_default/startup/50-dump.py +++ b/.ipython/profile_default/startup/50-dump.py @@ -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