Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 5 Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384):

"""
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')
Expand Down
4 changes: 3 additions & 1 deletion 4 Lib/test/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,10 @@ def test_ios_ver(self):
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'):
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.