Skip to content

Commit 29fb6c0

Browse files
committed
gh-138130: Fix return value of libc_ver() on Emscripten
1 parent be24ff0 commit 29fb6c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/platform.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384):
173173
174174
"""
175175
if not executable:
176+
if sys.platform == "emscripten":
177+
# Emscripten's os.confstr reports that it is glibc, so special case
178+
# it.
179+
ver = ".".join(str(x) for x in sys._emscripten_info.emscripten_version)
180+
return ("emscripten", ver)
176181
try:
177182
ver = os.confstr('CS_GNU_LIBC_VERSION')
178183
# parse 'glibc 2.28' as ('glibc', '2.28')

0 commit comments

Comments
 (0)