summaryrefslogtreecommitdiffstats
path: root/Lib/bdb.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-03-28 20:56:00 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-03-28 20:56:00 (GMT)
commit41cf50d613f90fa5a2c243b6ecd8d50f302f3f50 (patch)
tree4484f4563d37dd42ad0dff8014e6df99a5ee08ee /Lib/bdb.py
parent69b747b7358780c84d1cac1317bfb7d5baa4e6e3 (diff)
downloadcpython-41cf50d613f90fa5a2c243b6ecd8d50f302f3f50.zip
cpython-41cf50d613f90fa5a2c243b6ecd8d50f302f3f50.tar.gz
cpython-41cf50d613f90fa5a2c243b6ecd8d50f302f3f50.tar.bz2
#2498 modernized try, except, finally statements in bdb
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r--Lib/bdb.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 0c56b63..a5a3a19 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -362,10 +362,9 @@ class Bdb:
if not isinstance(cmd, types.CodeType):
cmd = cmd+'\n'
try:
- try:
- exec cmd in globals, locals
- except BdbQuit:
- pass
+ exec cmd in globals, locals
+ except BdbQuit:
+ pass
finally:
self.quitting = 1
sys.settrace(None)
@@ -381,10 +380,9 @@ class Bdb:
if not isinstance(expr, types.CodeType):
expr = expr+'\n'
try:
- try:
- return eval(expr, globals, locals)
- except BdbQuit:
- pass
+ return eval(expr, globals, locals)
+ except BdbQuit:
+ pass
finally:
self.quitting = 1
sys.settrace(None)
@@ -400,10 +398,9 @@ class Bdb:
sys.settrace(self.trace_dispatch)
res = None
try:
- try:
- res = func(*args, **kwds)
- except BdbQuit:
- pass
+ res = func(*args, **kwds)
+ except BdbQuit:
+ pass
finally:
self.quitting = 1
sys.settrace(None)