Skip to content

Commit c731723

Browse files
committed
Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it
exists.
1 parent a598bc4 commit c731723

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/getpass.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def getpass(prompt='Password: '):
1515
1616
On Windows, this calls win_getpass(prompt) which uses the
1717
msvcrt module to get the same effect.
18+
19+
On the Mac EasyDialogs.AskPassword is used, if available.
1820
1921
"""
2022

@@ -29,7 +31,12 @@ def getpass(prompt='Password: '):
2931
try:
3032
import msvcrt
3133
except ImportError:
32-
return default_getpass(prompt)
34+
try:
35+
from EasyDialogs import AskPassword
36+
except ImportError:
37+
return default_getpass(prompt)
38+
else:
39+
return AskPassword(prompt)
3340
else:
3441
return win_getpass(prompt)
3542

0 commit comments

Comments
 (0)