mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 23:00:18 +00:00
piped -> piped_in
This commit is contained in:
+5
-2
@@ -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
|
||||
Reference in New Issue
Block a user