piped -> piped_in

This commit is contained in:
Kenneth Reitz
2011-03-19 11:43:02 -04:00
parent acafeda63c
commit a79b06e138
+5 -2
View File
@@ -2,8 +2,11 @@
import sys
def piped():
def piped_in():
"""Returns piped input via stdin, else False."""
with sys.stdin as stdin:
# TTY is only way to detect if stdin contains data
return stdin.read() if not stdin.isatty() else None
if not stdin.isatty():
return stdin.read()
else:
return None