fix issue25 --pdb and win32/python encodings cause a crash in certain situations.

The reason is not clear but avoiding a fresh copy of the terminal writer
helps, maybe because the underlying file object has some state?
This commit is contained in:
holger krekel
2011-03-07 13:17:07 +01:00
parent f8e3fe8fbf
commit 5470cadbff
4 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -52,7 +52,10 @@ class PdbInvoke:
if "xfail" in rep.keywords:
return rep
# we assume that the above execute() suspended capturing
tw = py.io.TerminalWriter()
# XXX we re-use the TerminalReporter's terminalwriter
# because this seems to avoid some encoding related troubles
# for not completely clear reasons.
tw = item.config.pluginmanager.getplugin("terminalreporter")._tw
tw.line()
tw.sep(">", "traceback")
rep.toterminal(tw)