From 007bfad80c889844ec24cb0eacdefb0cad9caada Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 29 Dec 2021 19:47:36 +0000 Subject: [PATCH] `pwd` is not available on Windows (#6742) --- stdlib/pwd.pyi | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/stdlib/pwd.pyi b/stdlib/pwd.pyi index 3ed6111bd..08a9facf6 100644 --- a/stdlib/pwd.pyi +++ b/stdlib/pwd.pyi @@ -1,24 +1,25 @@ +import sys from _typeshed import structseq from typing import Any from typing_extensions import final -@final -class struct_passwd(structseq[Any], tuple[str, str, int, int, str, str, str]): - @property - def pw_name(self) -> str: ... - @property - def pw_passwd(self) -> str: ... - @property - def pw_uid(self) -> int: ... - @property - def pw_gid(self) -> int: ... - @property - def pw_gecos(self) -> str: ... - @property - def pw_dir(self) -> str: ... - @property - def pw_shell(self) -> str: ... - -def getpwall() -> list[struct_passwd]: ... -def getpwuid(__uid: int) -> struct_passwd: ... -def getpwnam(__name: str) -> struct_passwd: ... +if sys.platform != "win32": + @final + class struct_passwd(structseq[Any], tuple[str, str, int, int, str, str, str]): + @property + def pw_name(self) -> str: ... + @property + def pw_passwd(self) -> str: ... + @property + def pw_uid(self) -> int: ... + @property + def pw_gid(self) -> int: ... + @property + def pw_gecos(self) -> str: ... + @property + def pw_dir(self) -> str: ... + @property + def pw_shell(self) -> str: ... + def getpwall() -> list[struct_passwd]: ... + def getpwuid(__uid: int) -> struct_passwd: ... + def getpwnam(__name: str) -> struct_passwd: ...