[Python-checkins] python/dist/src/Lib doctest.py,1.118,1.119

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Mon Nov 8 23:30:32 CET 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17372/Lib

Modified Files:
	doctest.py 
Log Message:
_OutputRedirectingPdb.trace_dispatch():  Return the base class's
trace_dispatch() result in a more obvious, and more robust way.


Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- doctest.py	8 Nov 2004 22:07:35 -0000	1.118
+++ doctest.py	8 Nov 2004 22:30:28 -0000	1.119
@@ -348,10 +348,11 @@
         save_stdout = sys.stdout
         sys.stdout = self.__out
         # Call Pdb's trace dispatch method.
-        result = pdb.Pdb.trace_dispatch(self, *args)
-        # Restore stdout.
-        sys.stdout = save_stdout
-        return result
+        try:
+            return pdb.Pdb.trace_dispatch(self, *args)
+        finally:
+            # Restore stdout.
+            sys.stdout = save_stdout
 
 # [XX] Normalize with respect to os.path.pardir?
 def _module_relative_path(module, path):



More information about the Python-checkins mailing list