Skip to content
Prev Previous commit
Next Next commit
Fix sysconfig.get_platform() on WASI cross-compilation
Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Feb 13, 2025
commit abd4de1a654e33164ce1af9af6e24c6494234880
3 changes: 2 additions & 1 deletion Lib/sysconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ def get_platform():
# Set for cross builds explicitly
if "_PYTHON_HOST_PLATFORM" in os.environ:
osname, _, machine = os.environ["_PYTHON_HOST_PLATFORM"].partition('-')
release = None
else:
# Try to distinguish various flavours of Unix
osname, host, release, version, machine = os.uname()
Expand Down Expand Up @@ -725,7 +726,7 @@ def get_platform():
get_config_vars(),
osname, release, machine)

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


def get_python_version():
Expand Down