Handle sys.stdin, stdout are None under pythonw.

This commit is contained in:
Ethan Dalool 2020-11-05 22:00:36 -08:00
parent 98f42ad87b
commit 1468f318f8

View file

@ -7,8 +7,9 @@ CLIPBOARD_STRINGS = ['!c', '!clip', '!clipboard']
INPUT_STRINGS = ['!i', '!in', '!input', '!stdin'] INPUT_STRINGS = ['!i', '!in', '!input', '!stdin']
EOF = '\x1a' EOF = '\x1a'
IN_PIPE = not sys.stdin.isatty() # In pythonw, stdin and stdout are None.
OUT_PIPE = not sys.stdout.isatty() IN_PIPE = (sys.stdin is not None) and (not sys.stdin.isatty())
OUT_PIPE = (sys.stdout is not None) and (not sys.stdout.isatty())
class PipeableException(Exception): class PipeableException(Exception):
pass pass