work when piped, in windows too
This commit is contained in:
parent
5676d6afae
commit
8df28fb835
|
@ -45,8 +45,9 @@ SILENT = (
|
||||||
not in ("", "0", "off", "false")
|
not in ("", "0", "off", "false")
|
||||||
)
|
)
|
||||||
|
|
||||||
if not IS_WIN:
|
if not os.isatty(sys.stdin.fileno()):
|
||||||
sys.stdin = open("/dev/tty", "r")
|
# the script is being piped, we need to reset stdin
|
||||||
|
sys.stdin = open("CON:" if IS_WIN else "/dev/tty")
|
||||||
|
|
||||||
if sys.version_info.major == 2:
|
if sys.version_info.major == 2:
|
||||||
input = raw_input
|
input = raw_input
|
||||||
|
|
Loading…
Reference in New Issue