Rev 6084: Simplify and fix test.debug too. in file:///home/vila/src/bzr/bugs/412201-mv-case-insensitive/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Aug 19 16:39:26 UTC 2011


At file:///home/vila/src/bzr/bugs/412201-mv-case-insensitive/

------------------------------------------------------------
revno: 6084
revision-id: v.ladeuil+lp at free.fr-20110819163925-zysfy8is99v65weg
parent: v.ladeuil+lp at free.fr-20110819145855-oubrcf59cokg2bct
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 412201-mv-case-insensitive
timestamp: Fri 2011-08-19 18:39:25 +0200
message:
  Simplify and fix test.debug too.
-------------- next part --------------
=== modified file 'bzrlib/debug.py'
--- a/bzrlib/debug.py	2011-08-19 14:58:55 +0000
+++ b/bzrlib/debug.py	2011-08-19 16:39:25 +0000
@@ -40,7 +40,7 @@
         debug_flags.add(f)
 
 
-class BzrPdb(pdb.Pdb):
+def set_trace():
     """Pdb using original stdin and stdout.
 
     When debugging blackbox tests, sys.stdin and sys.stdout are captured for
@@ -55,10 +55,5 @@
 
        from bzrlib import debug; debug.set_trace()
     """
-
-    def __init__(self):
-        pdb.Pdb.__init__(self, stdin=sys.__stdin__, stdout=sys.__stdout__)
-
-
-def set_trace():
-    BzrPdb().set_trace(sys._getframe().f_back)
+    pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__
+            ).set_trace(sys._getframe().f_back)

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2011-08-16 13:12:40 +0000
+++ b/bzrlib/tests/__init__.py	2011-08-19 16:39:25 +0000
@@ -1009,7 +1009,9 @@
     def debug(self):
         # debug a frame up.
         import pdb
-        pdb.Pdb().set_trace(sys._getframe().f_back)
+        # The sys preserved stdin/stdout should allow blackbox tests debugging
+        pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__
+                ).set_trace(sys._getframe().f_back)
 
     def discardDetail(self, name):
         """Extend the addDetail, getDetails api so we can remove a detail.



More information about the bazaar-commits mailing list