summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-09-29 23:22:12 (GMT)
committerGuido van Rossum <guido@python.org>1997-09-29 23:22:12 (GMT)
commitf15d15964b6ac3e5ff71894707fbcff48bec45b2 (patch)
treee0fccf5a3756b03f3f0b2a265c65a175ffe61f09 /Lib/pdb.py
parentc90ad2103eb9aca14b7a910cbcdcd7b570f690ab (diff)
downloadcpython-f15d15964b6ac3e5ff71894707fbcff48bec45b2.zip
cpython-f15d15964b6ac3e5ff71894707fbcff48bec45b2.tar.gz
cpython-f15d15964b6ac3e5ff71894707fbcff48bec45b2.tar.bz2
Use sys.exc_info() where needed.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 99e6191..0dc15a2 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -80,10 +80,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
code = compile(line + '\n', '<stdin>', 'single')
exec code in globals, locals
except:
- if type(sys.exc_type) == type(''):
- exc_type_name = sys.exc_type
- else: exc_type_name = sys.exc_type.__name__
- print '***', exc_type_name + ':', sys.exc_value
+ t, v = sys.exc_info()[:2]
+ if type(t) == type(''):
+ exc_type_name = t
+ else: exc_type_name = t.__name__
+ print '***', exc_type_name + ':', v
# Command definitions, called by cmdloop()
# The argument is the remaining string on the command line
@@ -219,10 +220,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
value = eval(arg, self.curframe.f_globals, \
self.curframe.f_locals)
except:
- if type(sys.exc_type) == type(''):
- exc_type_name = sys.exc_type
- else: exc_type_name = sys.exc_type.__name__
- print '***', exc_type_name + ':', `sys.exc_value`
+ t, v = sys.exc_info()[:2]
+ if type(t) == type(''):
+ exc_type_name = t
+ else: exc_type_name = t.__name__
+ print '***', exc_type_name + ':', `v`
return
print `value`
@@ -277,10 +279,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
value = eval(arg, self.curframe.f_globals, \
self.curframe.f_locals)
except:
- if type(sys.exc_type) == type(''):
- exc_type_name = sys.exc_type
- else: exc_type_name = sys.exc_type.__name__
- print '***', exc_type_name + ':', `sys.exc_value`
+ t, v = sys.exc_info()[:2]
+ if type(t) == type(''):
+ exc_type_name = t
+ else: exc_type_name = t.__name__
+ print '***', exc_type_name + ':', `v`
return
code = None
# Is it a function?