diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py index 7dd59de..243e941 100644 --- a/IPython/core/oinspect.py +++ b/IPython/core/oinspect.py @@ -22,7 +22,6 @@ import StringIO import inspect import linecache import os -import string import sys import types from collections import namedtuple @@ -450,7 +449,7 @@ class Inspector: if not detail_level and len(ostr)>string_max: ostr = ostr[:shalf] + ' <...> ' + ostr[-shalf:] ostr = ("\n" + " " * len(str_head.expandtabs())).\ - join(map(string.strip,ostr.split("\n"))) + join(q.strip() for q in ostr.split("\n")) if ostr.find('\n') > -1: # Print multi-line strings starting at the next line. str_sep = '\n' @@ -675,7 +674,7 @@ class Inspector: if not detail_level and len(ostr)>string_max: ostr = ostr[:shalf] + ' <...> ' + ostr[-shalf:] ostr = ("\n" + " " * len(str_head.expandtabs())).\ - join(map(string.strip,ostr.split("\n"))) + join(q.strip() for q in ostr.split("\n")) if ostr.find('\n') > -1: # Print multi-line strings starting at the next line. str_sep = '\n' diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index 9a1bef2..fa3a748 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -77,7 +77,6 @@ import linecache import os import pydoc import re -import string import sys import time import tokenize @@ -707,7 +706,7 @@ class VerboseTB(TBTools): if self.long_header: # Header with the exception type, python version, and date - pyver = 'Python ' + string.split(sys.version)[0] + ': ' + sys.executable + pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) head = '%s%s%s\n%s%s%s\n%s' % (Colors.topline, '-'*75, ColorsNormal,