diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-07-09 08:47:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-09 08:47:45 (GMT) |
commit | 2a9b8babf0d09946ebebfdb2931cc0d3db5a1d3d (patch) | |
tree | 6efcfbee7390ccdf8d969068b603b707fa769b27 /Lib/test | |
parent | f85af035c5cb9a981f5e3164425f27cf73231b5f (diff) | |
download | cpython-2a9b8babf0d09946ebebfdb2931cc0d3db5a1d3d.zip cpython-2a9b8babf0d09946ebebfdb2931cc0d3db5a1d3d.tar.gz cpython-2a9b8babf0d09946ebebfdb2931cc0d3db5a1d3d.tar.bz2 |
bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_platform.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 7e3e401..9ecd5d9 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -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") |