diff options
author | Phil Sutter <phil@nwl.cc> | 2022-04-07 13:53:05 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2022-04-08 16:21:32 +0200 |
commit | 6fa4ff56385831f01bd9d993178969a4eddbcdbf (patch) | |
tree | 73d3bbc49a22c04804ff2b0cc38b7b3703469272 /tests/py/nft-test.py | |
parent | f561a0ccb0524eded2f2b9160b5c97bc569cc5e4 (diff) |
tests: py: Don't colorize output if stderr is redirected
Cover for calls with '2>/tmp/log' and avoid printing escape sequences to
that file. One could still keep colored output on stdout, but that
required a printing routine for non-errors.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/py/nft-test.py')
-rwxr-xr-x | tests/py/nft-test.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 04dac8d7..b66a33c2 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -39,7 +39,7 @@ signal_received = 0 class Colors: - if sys.stdout.isatty(): + if sys.stdout.isatty() and sys.stderr.isatty(): HEADER = '\033[95m' GREEN = '\033[92m' YELLOW = '\033[93m' |