diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-10 00:22:33 (GMT) |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-10 00:22:33 (GMT) |
commit | 6e025bcde84ec358734a116cefcc4acc357ee0b1 (patch) | |
tree | 0e9d1e6ec181e63e8a88d7af05e2e9e49f2ca294 /Lib/traceback.py | |
parent | c8c6aa201f03393ada787a1bde88cd2092d2361c (diff) | |
download | cpython-6e025bcde84ec358734a116cefcc4acc357ee0b1.zip cpython-6e025bcde84ec358734a116cefcc4acc357ee0b1.tar.gz cpython-6e025bcde84ec358734a116cefcc4acc357ee0b1.tar.bz2 |
String method cleanup.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 6 |
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 + ' ' |