[Python-checkins] cpython (2.7): Have Bdb frame_returning in the finally clause

senthil.kumaran python-checkins at python.org
Tue May 1 04:47:22 CEST 2012


http://hg.python.org/cpython/rev/4c3c4891fd6a
changeset:   76679:4c3c4891fd6a
branch:      2.7
parent:      76677:5ea23739e9ba
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Tue May 01 10:46:59 2012 +0800
summary:
  Have Bdb frame_returning in the finally clause

files:
  Lib/bdb.py |  8 +++++---
  1 files changed, 5 insertions(+), 3 deletions(-)


diff --git a/Lib/bdb.py b/Lib/bdb.py
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -83,9 +83,11 @@
 
     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
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list