Fix OSError in tmpdir on emscripten due to missing getuid()

Fixes #10765
This commit is contained in:
rdb 2023-02-24 23:23:44 +01:00
parent 9ccae9a8e3
commit c237297b3d
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Fix temp_path fixture always raising OSError on emscripten due to missing getuid

View File

@ -176,7 +176,7 @@ class TempPathFactory:
# Also, to keep things private, fixup any world-readable temp # Also, to keep things private, fixup any world-readable temp
# rootdir's permissions. Historically 0o755 was used, so we can't # rootdir's permissions. Historically 0o755 was used, so we can't
# just error out on this, at least for a while. # just error out on this, at least for a while.
if sys.platform != "win32": if sys.platform != "win32" and sys.platform != "emscripten":
uid = os.getuid() uid = os.getuid()
rootdir_stat = rootdir.stat() rootdir_stat = rootdir.stat()
# getuid shouldn't fail, but cpython defines such a case. # getuid shouldn't fail, but cpython defines such a case.