Don't use escape sequences if being redirected.

This commit is contained in:
Paul Romano 2014-04-10 23:21:44 -04:00
parent 10014fd23d
commit 04878cdb72

View file

@ -249,10 +249,16 @@ for test in tests:
print('\n' + '='*54)
print('Summary of Compilation Option Testing:\n')
OK = '\033[92m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
if sys.stdout.isatty():
OK = '\033[92m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
else:
OK = ''
FAIL = ''
ENDC = ''
BOLD = ''
for test in tests:
print(test + '.'*(50 - len(test)), end='')