]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
handle empty string in variable executable in platform.libc_ver() (#23140)
authorKurochan <kuro@kurochan.org>
Sat, 2 Jan 2021 16:03:53 +0000 (01:03 +0900)
committerGitHub <noreply@github.com>
Sat, 2 Jan 2021 16:03:53 +0000 (17:03 +0100)
Lib/platform.py
Misc/NEWS.d/next/Library/2020-12-31-23-05-53.bpo-42257.ALQy7B.rst [new file with mode: 0644]

index 985e12d9684eae933b3a839c0e92d17a3bcbb13c..d567dd1a6e1ad7d58afd53a3d42be68070e77eea 100755 (executable)
@@ -174,7 +174,7 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384):
         The file is read and scanned in chunks of chunksize bytes.
 
     """
-    if executable is None:
+    if not executable:
         try:
             ver = os.confstr('CS_GNU_LIBC_VERSION')
             # parse 'glibc 2.28' as ('glibc', '2.28')
diff --git a/Misc/NEWS.d/next/Library/2020-12-31-23-05-53.bpo-42257.ALQy7B.rst b/Misc/NEWS.d/next/Library/2020-12-31-23-05-53.bpo-42257.ALQy7B.rst
new file mode 100644 (file)
index 0000000..9a026d5
--- /dev/null
@@ -0,0 +1 @@
+Handle empty string in variable executable in platform.libc_ver()