| •1 |
#!/usr/bin/python3 |
| 2 |
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. |
| 3 |
|
| 4 |
# check that stripped ANSI in redirected stderr does not affect stdout |
| 5 |
from __future__ import print_function |
| 6 |
import sys |
| 7 |
import fixpath |
| 8 |
from colorama import init, Fore |
| 9 |
|
| 10 |
init() |
| 11 |
print(Fore.GREEN + 'GREEN set on stdout. ', end='') |
| 12 |
print(Fore.RED + 'RED redirected stderr', file=sys.stderr) |
| 13 |
print('Further stdout should be GREEN, i.e., the stderr redirection should not affect stdout.') |