]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it
authorGuido van Rossum <guido@python.org>
Thu, 11 Feb 1999 14:41:46 +0000 (14:41 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 11 Feb 1999 14:41:46 +0000 (14:41 +0000)
exists.

Lib/getpass.py

index 66b1aeebcf546f82721c836226c20264f87f5c08..952e023d1efe1b3b6f30e84e56515c2bb7737439 100644 (file)
@@ -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)