summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 834c568..b4fe050 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -1,7 +1,6 @@
"""Extract, format and print information about Python stack traces."""
import linecache
-import string
import sys
import types
@@ -154,13 +153,12 @@ def format_exception_only(etype, value):
list.append(' File "%s", line %d\n' %
(filename, lineno))
i = 0
- while i < len(line) and \
- line[i] in string.whitespace:
+ while i < len(line) and line[i].isspace():
i = i+1
list.append(' %s\n' % line.strip())
s = ' '
for c in line[i:offset-1]:
- if c in string.whitespace:
+ if c.isspace():
s = s + c
else:
s = s + ' '