summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-05 13:04:52 (GMT)
committerGitHub <noreply@github.com>2018-12-05 13:04:52 (GMT)
commit476b113ed8531b9fbb0bd023a05eb3af21996600 (patch)
tree820e7430ff8bcbcd4ed46cde4fcb6ac487e0e7eb /Misc
parent2a893430c9c8378cbdfac95895a64fa07aaff9ed (diff)
downloadcpython-476b113ed8531b9fbb0bd023a05eb3af21996600.zip
cpython-476b113ed8531b9fbb0bd023a05eb3af21996600.tar.gz
cpython-476b113ed8531b9fbb0bd023a05eb3af21996600.tar.bz2
bpo-35389: platform.libc_ver() uses os.confstr() (GH-10891)
platform.libc_ver() now uses os.confstr('CS_GNU_LIBC_VERSION') if available and the *executable* parameter is not set. The default value of the libc_ver() *executable* parameter becomes None. Quick benchmark on Fedora 29: python3 -m perf command ./python -S -c 'import platform; platform.libc_ver()' 94.9 ms +- 4.3 ms -> 33.2 ms +- 1.4 ms: 2.86x faster (-65%)
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2018-12-04-12-46-05.bpo-35389.CTZ9iA.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2018-12-04-12-46-05.bpo-35389.CTZ9iA.rst b/Misc/NEWS.d/next/Library/2018-12-04-12-46-05.bpo-35389.CTZ9iA.rst
new file mode 100644
index 0000000..8e2f9dd
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-12-04-12-46-05.bpo-35389.CTZ9iA.rst
@@ -0,0 +1,2 @@
+:func:`platform.libc_ver` now uses ``os.confstr('CS_GNU_LIBC_VERSION')`` if
+available and the *executable* parameter is not set.