From: Guido van Rossum Date: Thu, 11 Feb 1999 14:41:46 +0000 (+0000) Subject: Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it X-Git-Tag: v1.5.2b2~86 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c731723730cfefe0477897d31cabc930a028445f;p=thirdparty%2FPython%2Fcpython.git Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it exists. --- diff --git a/Lib/getpass.py b/Lib/getpass.py index 66b1aeebcf54..952e023d1efe 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)