summaryrefslogtreecommitdiffstats
path: root/Lib/getpass.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-02-11 14:41:46 (GMT)
committerGuido van Rossum <guido@python.org>1999-02-11 14:41:46 (GMT)
commitc731723730cfefe0477897d31cabc930a028445f (patch)
tree7ac8142ae2c85a6925680576183ef06e8df0232c /Lib/getpass.py
parenta598bc412c6895244961fb0b8f33dbea6e26cf65 (diff)
downloadcpython-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/getpass.py')
-rw-r--r--Lib/getpass.py9
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)