diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 09:39:08 (GMT) |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 09:39:08 (GMT) |
commit | ec3bbdef94703b7a69dcc758a4059046bc4d79f0 (patch) | |
tree | aa8a7040f69dc49f113b704c520bedfbb9ed7a8a /Lib/traceback.py | |
parent | 92852ad9a44183599a98c135e016e66660a91f13 (diff) | |
download | cpython-ec3bbdef94703b7a69dcc758a4059046bc4d79f0.zip cpython-ec3bbdef94703b7a69dcc758a4059046bc4d79f0.tar.gz cpython-ec3bbdef94703b7a69dcc758a4059046bc4d79f0.tar.bz2 |
String method conversion.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 7097b8f..834c568 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -18,7 +18,7 @@ def print_list(extracted_list, file=None): _print(file, ' File "%s", line %d, in %s' % (filename,lineno,name)) if line: - _print(file, ' %s' % string.strip(line)) + _print(file, ' %s' % line.strip()) def format_list(extracted_list): """Given a list of tuples as returned by extract_tb() or @@ -31,7 +31,7 @@ def format_list(extracted_list): for filename, lineno, name, line in extracted_list: item = ' File "%s", line %d, in %s\n' % (filename,lineno,name) if line: - item = item + ' %s\n' % string.strip(line) + item = item + ' %s\n' % line.strip() list.append(item) return list @@ -56,7 +56,7 @@ def print_tb(tb, limit=None, file=None): _print(file, ' File "%s", line %d, in %s' % (filename,lineno,name)) line = linecache.getline(filename, lineno) - if line: _print(file, ' ' + string.strip(line)) + if line: _print(file, ' ' + line.strip()) tb = tb.tb_next n = n+1 @@ -85,7 +85,7 @@ def extract_tb(tb, limit = None): filename = co.co_filename name = co.co_name line = linecache.getline(filename, lineno) - if line: line = string.strip(line) + if line: line = line.strip() else: line = None list.append((filename, lineno, name, line)) tb = tb.tb_next @@ -157,7 +157,7 @@ def format_exception_only(etype, value): while i < len(line) and \ line[i] in string.whitespace: i = i+1 - list.append(' %s\n' % string.strip(line)) + list.append(' %s\n' % line.strip()) s = ' ' for c in line[i:offset-1]: if c in string.whitespace: @@ -246,7 +246,7 @@ def extract_stack(f=None, limit = None): filename = co.co_filename name = co.co_name line = linecache.getline(filename, lineno) - if line: line = string.strip(line) + if line: line = line.strip() else: line = None list.append((filename, lineno, name, line)) f = f.f_back |