Skip to content

Commit 84c5fe4

Browse files
committed
Ignore os.getuid() mypy error
Error happens on Windows and can be ignored because we check `getuid()` using `hasattr` right above.
1 parent c85b21e commit 84c5fe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/tmpdir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def getbasetemp(self) -> Path:
131131
# rootdir's permissions. Historically 0o755 was used, so we can't
132132
# just error out on this, at least for a while.
133133
if hasattr(os, "getuid"):
134+
uid = os.getuid() # type:ignore[attr-defined]
134135
rootdir_stat = rootdir.stat()
135-
uid = os.getuid()
136136
# getuid shouldn't fail, but cpython defines such a case.
137137
# Let's hope for the best.
138138
if uid != -1:

0 commit comments

Comments
 (0)