Skip to content

Commit f928a5c

Browse files
committed
fix pylint for windows
1 parent 0c8ce47 commit f928a5c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exec_helpers/_ssh_client_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,10 @@ def __get_user_for_log(real_auth: ssh_auth.SSHAuth) -> typing.Optional[str]: #
322322
# noinspection PyBroadException
323323
try:
324324
if sys.platform != "win32":
325-
import pwd # pylint: disable=import-outside-toplevel
325+
import pwd # pylint: disable=import-outside-toplevel,import-error
326326

327-
return pwd.getpwuid(os.getuid()).pw_name # Correct for not windows only
327+
uid: int = os.getuid() # pylint: disable=no-member
328+
return pwd.getpwuid(uid).pw_name # Correct for not windows only
328329
return getpass.getuser()
329330
except Exception:
330331
return None

0 commit comments

Comments
 (0)