Kaydet (Commit) 41cf50d6 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

#2498 modernized try, except, finally statements in bdb

üst 69b747b7
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment