Here is a patch about the colorful traceback display.
My use case is to redisplay the provided traceback in my continuous integration
system but the trace is already mangled by ANSI characters.
IMO, we should only provide colorful traceback if we're sure that the current
stderr is a valid TTY (which mimicks the ls --color behaviour that way)
Cordially,
Julien Jehannet (1):
Do not enable colorful traceback if stderr is not a tty
windmill/dep/_functest/frame.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/windmill/dep/_functest/frame.py b/windmill/dep/_functest/frame.py
index eafc886..9904c73 100755
--- a/windmill/dep/_functest/frame.py
+++ b/windmill/dep/_functest/frame.py
@@ -152,7 +152,7 @@ def run_test_function(test, args=[]):
return True
except AssertionError, inst:
test.endtime = datetime.now()
- if pygments:
+ if pygments and sys.stderr.isatty():
formatter.highlight_traceback(sys.exc_info())
else:
tb = traceback.format_exception(*sys.exc_info())
@@ -169,7 +169,7 @@ def run_test_function(test, args=[]):
return False
except Exception, inst:
test.endtime = datetime.now()
- if pygments:
+ if pygments and sys.stderr.isatty():
formatter.highlight_traceback(sys.exc_info())
else:
tb = traceback.format_exception(*sys.exc_info())
--
1.5.6.5
--
You received this message because you are subscribed to the Google Groups "Windmill Developers" group.
To post to this group, send email to windmi...@googlegroups.com.
To unsubscribe from this group, send email to windmill-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/windmill-dev?hl=en.