diff options
author | Guido van Rossum <guido@python.org> | 2007-03-19 22:23:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-03-19 22:23:59 (GMT) |
commit | 7cba8508afeac3c631ea225df2df0e4918c610ab (patch) | |
tree | 91ba6076d45294c35d0c8de942d971200fe1c6bc | |
parent | e66c8c7c127370ab7d0055f98053caad48cbc135 (diff) | |
download | cpython-7cba8508afeac3c631ea225df2df0e4918c610ab.zip cpython-7cba8508afeac3c631ea225df2df0e4918c610ab.tar.gz cpython-7cba8508afeac3c631ea225df2df0e4918c610ab.tar.bz2 |
Use input() now that it is available.
-rw-r--r-- | Lib/urllib.py | 6 |
1 files changed, 2 insertions, 4 deletions
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 @@ class FancyURLopener(URLopener): 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 |