show color in hook outputs when attached to a tty

This commit is contained in:
Anthony Sottile 2019-10-12 15:57:40 -07:00
parent c8620f35e1
commit 7c3404ef1f
27 changed files with 200 additions and 76 deletions

View file

@ -1,13 +0,0 @@
#!/usr/bin/env python
import sys
def main():
for i in range(6):
f = sys.stdout if i % 2 == 0 else sys.stderr
f.write('{}\n'.format(i))
f.flush()
if __name__ == '__main__':
exit(main())