From: José Fonseca Date: Wed, 25 Mar 2009 10:22:05 +0000 (+0000) Subject: python: Use Ansi escape codes regardless of output is a tty or not. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5743483778ffe5b389d10b1651ae1e8951b397ee;p=mesa.git python: Use Ansi escape codes regardless of output is a tty or not. --- diff --git a/src/gallium/state_trackers/python/retrace/format.py b/src/gallium/state_trackers/python/retrace/format.py index 0bf6baf0b94..d56d72f606f 100755 --- a/src/gallium/state_trackers/python/retrace/format.py +++ b/src/gallium/state_trackers/python/retrace/format.py @@ -27,6 +27,9 @@ ########################################################################## +import sys + + class Formatter: '''Plain formatter''' @@ -93,7 +96,7 @@ class AnsiFormatter(Formatter): def DefaultFormatter(stream): - if stream.isatty(): + if sys.platform in ('linux2', 'cygwin'): return AnsiFormatter(stream) else: return Formatter(stream)