mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
String method cleanup.
This commit is contained in:
parent
c8c6aa201f
commit
6e025bcde8
5 changed files with 7 additions and 13 deletions
|
@ -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 + ' '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue