Use input() now that it is available.
diff --git a/Lib/urllib.py b/Lib/urllib.py
index d2ae1be..6a2b293 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -768,11 +768,9 @@
def prompt_user_passwd(self, host, realm):
"""Override this in a GUI environment!"""
- import getpass, sys
+ import getpass
try:
- sys.stdout.write("Enter username for %s at %s: " % (realm, host))
- sys.stdout.flush()
- user = sys.stdin.readline()
+ user = input("Enter username for %s at %s: " % (realm, host))
passwd = getpass.getpass("Enter password for %s in %s at %s: " %
(user, realm, host))
return user, passwd