mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Use sys.exc_info() where needed.
This commit is contained in:
parent
c90ad2103e
commit
f15d15964b
9 changed files with 38 additions and 32 deletions
11
Lib/tb.py
11
Lib/tb.py
|
@ -74,13 +74,14 @@ def browserexec(tb, cmd):
|
|||
try:
|
||||
exec cmd+'\n' in globals, locals
|
||||
except:
|
||||
t, v = sys.exc_info()[:2]
|
||||
print '*** Exception:',
|
||||
if type(sys.exc_type) == type(''):
|
||||
print sys.exc_type,
|
||||
if type(t) == type(''):
|
||||
print t,
|
||||
else:
|
||||
print sys.exc_type.__name__,
|
||||
if sys.exc_value <> None:
|
||||
print ':', sys.exc_value,
|
||||
print t.__name__,
|
||||
if v <> None:
|
||||
print ':', v,
|
||||
print
|
||||
print 'Type help to get help.'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue