Fiddle with compact_traceback().

More whitespace cleanup.
This commit is contained in:
Guido van Rossum 2002-09-13 14:09:26 +00:00
parent a0378e1eda
commit 12e9668989
1 changed files with 6 additions and 7 deletions

View File

@ -463,21 +463,20 @@ class dispatcher_with_send(dispatcher):
def compact_traceback():
t, v, tb = sys.exc_info()
tbinfo = []
while 1:
assert tb # Must have a traceback
while tb:
tbinfo.append((
tb.tb_frame.f_code.co_filename,
tb.tb_frame.f_code.co_name,
str(tb.tb_lineno)
))
tb = tb.tb_next
if not tb:
break
# just to be safe
del tb
file, function, line = tbinfo[-1]
info = '[' + '] ['.join(map(lambda x: '|'.join(x), tbinfo)) + ']'
info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo])
return (file, function, line), t, v, info
def close_all(map=None):