handle empty string in variable executable in platform.libc_ver() (#23140)

This commit is contained in:
Kurochan 2021-01-03 01:03:53 +09:00 committed by GitHub
parent 11276cd9c4
commit d9142831ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -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')

View file

@ -0,0 +1 @@
Handle empty string in variable executable in platform.libc_ver()