From c731723730cfefe0477897d31cabc930a028445f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 11 Feb 1999 14:41:46 +0000 Subject: [PATCH] Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it exists. --- Lib/getpass.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/getpass.py b/Lib/getpass.py index 66b1aeebcf5..952e023d1ef 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)