Mercurial > cpython-lru_cache-weakref
diff Lib/doctest.py @ 44013:14aa3e4e7375 legacy-trunk
back in these go - thanks to Titus Brown for the fix
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Sat, 24 Nov 2007 14:30:47 +0000 |
| parents | 155e9725da2f |
| children | 5d1049d4c3c6 |
line wrap: on
line diff
--- a/Lib/doctest.py Sat Nov 24 13:56:09 2007 +0000 +++ b/Lib/doctest.py Sat Nov 24 14:30:47 2007 +0000 @@ -320,8 +320,21 @@ """ def __init__(self, out): self.__out = out + self.__debugger_used = False pdb.Pdb.__init__(self, stdout=out) + def set_trace(self, frame=None): + self.__debugger_used = True + if frame is None: + frame = sys._getframe().f_back + pdb.Pdb.set_trace(self, frame) + + def set_continue(self): + # Calling set_continue unconditionally would break unit test + # coverage reporting, as Bdb.set_continue calls sys.settrace(None). + if self.__debugger_used: + pdb.Pdb.set_continue(self) + def trace_dispatch(self, *args): # Redirect stdout to the given stream. save_stdout = sys.stdout
