diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/DebugClients/Python/getpass.py --- a/src/eric7/DebugClients/Python/getpass.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/DebugClients/Python/getpass.py Wed Jul 13 14:55:47 2022 +0200 @@ -22,28 +22,29 @@ First try various environment variables, then the password database. This works on Windows as long as USERNAME is set. - + @return username @rtype str """ # this is copied from the original getpass.py - + import os - for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'): + for name in ("LOGNAME", "USER", "LNAME", "USERNAME"): user = os.environ.get(name) if user: return user # If this fails, the exception will "explain" why import pwd + return pwd.getpwuid(os.getuid())[0] -def getpass(prompt='Password: ', stream=None): +def getpass(prompt="Password: ", stream=None): """ Function to prompt for a password, with echo turned off. - + @param prompt Prompt to be shown to the user @type str @param stream input stream to read from (ignored) @@ -51,7 +52,7 @@ @return Password entered by the user @rtype str """ - return input(prompt, False) # secok + return input(prompt, False) # secok unix_getpass = getpass