Have Bdb frame_returning in the finally clause

This commit is contained in:
Senthil Kumaran 2012-05-01 10:46:59 +08:00
parent 7f6d4e1926
commit dc8cb3d08f

View file

@ -83,9 +83,11 @@ class Bdb:
def dispatch_return(self, frame, arg):
if self.stop_here(frame) or frame == self.returnframe:
self.frame_returning = frame
self.user_return(frame, arg)
self.frame_returning = None
try:
self.frame_returning = frame
self.user_return(frame, arg)
finally:
self.frame_returning = None
if self.quitting: raise BdbQuit
return self.trace_dispatch