Skip to content

Commit 4c41f21

Browse files
gh-90473: disable user site packages on WASI/Emscripten (GH-93633)
(cherry picked from commit 5a4af3a) Co-authored-by: Christian Heimes <christian@python.org>
1 parent 2084f94 commit 4c41f21

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Lib/site.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ def _getuserbase():
266266
if env_base:
267267
return env_base
268268

269-
# VxWorks has no home directories
270-
if sys.platform == "vxworks":
269+
# Emscripten, VxWorks, and WASI have no home directories
270+
if sys.platform in {"emscripten", "vxworks", "wasi"}:
271271
return None
272272

273273
def joinuser(*args):

Lib/sysconfig.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def _getuserbase():
111111
if env_base:
112112
return env_base
113113

114-
# VxWorks has no home directories
115-
if sys.platform == "vxworks":
114+
# Emscripten, VxWorks, and WASI have no home directories
115+
if sys.platform in {"emscripten", "vxworks", "wasi"}:
116116
return None
117117

118118
def joinuser(*args):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Emscripten and WASI have no home directory and cannot provide :pep:`370`
2+
user site directory.

0 commit comments

Comments
 (0)