From 2820a9de5b7374240d3ef8308226524671ed9a92 Mon Sep 17 00:00:00 2001 From: kurochan Date: Wed, 4 Nov 2020 15:13:42 +0900 Subject: [PATCH] handle empty string in variable executable in platform.libc_ver() --- Lib/platform.py | 2 +- .../next/Library/2020-12-31-23-05-53.bpo-42257.ALQy7B.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-12-31-23-05-53.bpo-42257.ALQy7B.rst diff --git a/Lib/platform.py b/Lib/platform.py index 985e12d9684eae..d567dd1a6e1ad7 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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 index 00000000000000..9a026d5cdda277 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-12-31-23-05-53.bpo-42257.ALQy7B.rst @@ -0,0 +1 @@ +Handle empty string in variable executable in platform.libc_ver()