mirror of
https://github.com/python/cpython.git
synced 2025-01-21 07:55:16 +08:00
Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it
exists.
This commit is contained in:
parent
a598bc412c
commit
c731723730
@ -15,6 +15,8 @@ def getpass(prompt='Password: '):
|
||||
|
||||
On Windows, this calls win_getpass(prompt) which uses the
|
||||
msvcrt module to get the same effect.
|
||||
|
||||
On the Mac EasyDialogs.AskPassword is used, if available.
|
||||
|
||||
"""
|
||||
|
||||
@ -29,7 +31,12 @@ def getpass(prompt='Password: '):
|
||||
try:
|
||||
import msvcrt
|
||||
except ImportError:
|
||||
return default_getpass(prompt)
|
||||
try:
|
||||
from EasyDialogs import AskPassword
|
||||
except ImportError:
|
||||
return default_getpass(prompt)
|
||||
else:
|
||||
return AskPassword(prompt)
|
||||
else:
|
||||
return win_getpass(prompt)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user