mirror of
https://github.com/python/cpython
synced 2024-09-04 15:56:13 +00:00
Merged revisions 62018 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62018 | benjamin.peterson | 2008-03-28 21:56:00 +0100 (Fr, 28 Mär 2008) | 2 lines #2498 modernized try, except, finally statments in bdb ........
This commit is contained in:
parent
a3ab99dcd9
commit
ede8ffba96
21
Lib/bdb.py
21
Lib/bdb.py
|
@ -361,10 +361,9 @@ def run(self, cmd, globals=None, locals=None):
|
|||
if not isinstance(cmd, types.CodeType):
|
||||
cmd = cmd+'\n'
|
||||
try:
|
||||
try:
|
||||
exec(cmd, globals, locals)
|
||||
except BdbQuit:
|
||||
pass
|
||||
exec(cmd, globals, locals)
|
||||
except BdbQuit:
|
||||
pass
|
||||
finally:
|
||||
self.quitting = 1
|
||||
sys.settrace(None)
|
||||
|
@ -380,10 +379,9 @@ def runeval(self, expr, globals=None, locals=None):
|
|||
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)
|
||||
|
@ -399,10 +397,9 @@ def runcall(self, func, *args, **kwds):
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue