Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it

exists.
This commit is contained in:
Guido van Rossum 1999-02-11 14:41:46 +00:00
parent a598bc412c
commit c731723730

View file

@ -16,6 +16,8 @@ def getpass(prompt='Password: '):
On Windows, this calls win_getpass(prompt) which uses the On Windows, this calls win_getpass(prompt) which uses the
msvcrt module to get the same effect. msvcrt module to get the same effect.
On the Mac EasyDialogs.AskPassword is used, if available.
""" """
import sys import sys
@ -28,8 +30,13 @@ def getpass(prompt='Password: '):
except ImportError: except ImportError:
try: try:
import msvcrt import msvcrt
except ImportError:
try:
from EasyDialogs import AskPassword
except ImportError: except ImportError:
return default_getpass(prompt) return default_getpass(prompt)
else:
return AskPassword(prompt)
else: else:
return win_getpass(prompt) return win_getpass(prompt)