From 722f573c3c8e18abc7d0d5543fe66e2272636f83 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 16 Jul 2015 00:10:42 -0400 Subject: [PATCH] ipython: support py3 a bit better --- .ipython/profile_default/startup/50-dump.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.5