Skip to content

Commit abd4de1

Browse files
committed
Fix sysconfig.get_platform() on WASI cross-compilation
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent 8b6eb32 commit abd4de1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/sysconfig/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ def get_platform():
667667
# Set for cross builds explicitly
668668
if "_PYTHON_HOST_PLATFORM" in os.environ:
669669
osname, _, machine = os.environ["_PYTHON_HOST_PLATFORM"].partition('-')
670+
release = None
670671
else:
671672
# Try to distinguish various flavours of Unix
672673
osname, host, release, version, machine = os.uname()
@@ -725,7 +726,7 @@ def get_platform():
725726
get_config_vars(),
726727
osname, release, machine)
727728

728-
return f"{osname}-{release}-{machine}"
729+
return '-'.join(filter(None, (osname, release, machine)))
729730

730731

731732
def get_python_version():

0 commit comments

Comments
 (0)