summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:49:51 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:49:51 (GMT)
commitce96f69d69a6020c780145c89a17a8391b63624b (patch)
tree7325a9bfaddf191e49910532df1fa4210c335196 /Lib/urllib.py
parent9e2b9665ae9f94a07da54156c48e2cd411a23746 (diff)
downloadcpython-ce96f69d69a6020c780145c89a17a8391b63624b.zip
cpython-ce96f69d69a6020c780145c89a17a8391b63624b.tar.gz
cpython-ce96f69d69a6020c780145c89a17a8391b63624b.tar.bz2
Get rid of a bunch more raw_input references
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index aeca3f1..136f42e 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -768,10 +768,11 @@ class FancyURLopener(URLopener):
def prompt_user_passwd(self, host, realm):
"""Override this in a GUI environment!"""
- import getpass
+ import getpass, sys
try:
- user = raw_input("Enter username for %s at %s: " % (realm,
- host))
+ sys.stdout.write("Enter username for %s at %s: " % (realm, host))
+ sys.stdout.flush()
+ user = sys.stdin.readline()
passwd = getpass.getpass("Enter password for %s in %s at %s: " %
(user, realm, host))
return user, passwd