Skip to content

Commit d914283

Browse files
authored
handle empty string in variable executable in platform.libc_ver() (#23140)
1 parent 11276cd commit d914283

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384):
174174
The file is read and scanned in chunks of chunksize bytes.
175175
176176
"""
177-
if executable is None:
177+
if not executable:
178178
try:
179179
ver = os.confstr('CS_GNU_LIBC_VERSION')
180180
# parse 'glibc 2.28' as ('glibc', '2.28')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Handle empty string in variable executable in platform.libc_ver()

0 commit comments

Comments
 (0)