mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Use input() now that it is available.
This commit is contained in:
parent
e66c8c7c12
commit
7cba8508af
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue