From 04878cdb72715028fa125f81a77da8e827461ef1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 10 Apr 2014 23:21:44 -0400 Subject: [PATCH] Don't use escape sequences if being redirected. --- tests/run_tests.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 43f6e1abfd..ce67f3ab7a 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -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='')