summaryrefslogtreecommitdiff
path: root/Lib/getpass.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/getpass.py')
-rw-r--r--Lib/getpass.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/getpass.py b/Lib/getpass.py
index 6b786122ec..07c89ff0b9 100644
--- a/Lib/getpass.py
+++ b/Lib/getpass.py
@@ -24,6 +24,10 @@ def unix_getpass(prompt='Password: ', stream=None):
if stream is None:
stream = sys.stdout
+ if not sys.stdin.isatty():
+ print >>sys.stderr, "Warning: sys.stdin is not a tty."
+ return default_getpass(prompt)
+
try:
fd = sys.stdin.fileno()
except: