Emscripten's libc is a hybrid of musl and llvm libc; but it reports that it is
"glibc". This modifies the return value of `platform.libc_ver()` to return
something that is Emscripten-specific.
"""
if not executable:
+ if sys.platform == "emscripten":
+ # Emscripten's os.confstr reports that it is glibc, so special case
+ # it.
+ ver = ".".join(str(x) for x in sys._emscripten_info.emscripten_version)
+ return ("emscripten", ver)
try:
ver = os.confstr('CS_GNU_LIBC_VERSION')
# parse 'glibc 2.28' as ('glibc', '2.28')
self.assertEqual(override.model, "Whiz")
self.assertTrue(override.is_simulator)
- @unittest.skipIf(support.is_emscripten, "Does not apply to Emscripten")
def test_libc_ver(self):
+ if support.is_emscripten:
+ assert platform.libc_ver() == ("emscripten", "4.0.12")
+ return
# check that libc_ver(executable) doesn't raise an exception
if os.path.isdir(sys.executable) and \
os.path.exists(sys.executable+'.exe'):