bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684)

This commit is contained in:
Serhiy Storchaka 2018-07-09 11:47:45 +03:00 committed by GitHub
parent f85af035c5
commit 2a9b8babf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 13 deletions

View file

@ -260,7 +260,6 @@ class PlatformTest(unittest.TestCase):
self.assertEqual(sts, 0)
def test_libc_ver(self):
import os
if os.path.isdir(sys.executable) and \
os.path.exists(sys.executable+'.exe'):
# Cygwin horror
@ -269,6 +268,13 @@ class PlatformTest(unittest.TestCase):
executable = sys.executable
res = platform.libc_ver(executable)
self.addCleanup(support.unlink, support.TESTFN)
with open(support.TESTFN, 'wb') as f:
f.write(b'x'*(16384-10))
f.write(b'GLIBC_1.23.4\0GLIBC_1.9\0GLIBC_1.21\0')
self.assertEqual(platform.libc_ver(support.TESTFN),
('glibc', '1.23.4'))
def test_popen(self):
mswindows = (sys.platform == "win32")