We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c8ce47 commit f928a5cCopy full SHA for f928a5c
exec_helpers/_ssh_client_base.py
@@ -322,9 +322,10 @@ def __get_user_for_log(real_auth: ssh_auth.SSHAuth) -> typing.Optional[str]: #
322
# noinspection PyBroadException
323
try:
324
if sys.platform != "win32":
325
- import pwd # pylint: disable=import-outside-toplevel
+ import pwd # pylint: disable=import-outside-toplevel,import-error
326
327
- return pwd.getpwuid(os.getuid()).pw_name # Correct for not windows only
+ uid: int = os.getuid() # pylint: disable=no-member
328
+ return pwd.getpwuid(uid).pw_name # Correct for not windows only
329
return getpass.getuser()
330
except Exception:
331
return None
0 commit comments