diff options
author | Guido van Rossum <guido@python.org> | 1999-02-11 14:41:46 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-02-11 14:41:46 (GMT) |
commit | c731723730cfefe0477897d31cabc930a028445f (patch) | |
tree | 7ac8142ae2c85a6925680576183ef06e8df0232c /Lib | |
parent | a598bc412c6895244961fb0b8f33dbea6e26cf65 (diff) | |
download | cpython-c731723730cfefe0477897d31cabc930a028445f.zip cpython-c731723730cfefe0477897d31cabc930a028445f.tar.gz cpython-c731723730cfefe0477897d31cabc930a028445f.tar.bz2 |
Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it
exists.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/getpass.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/getpass.py b/Lib/getpass.py index 66b1aee..952e023 100644 --- a/Lib/getpass.py +++ b/Lib/getpass.py @@ -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) |