Skip to content

Commit 4734c4c

Browse files
authored
Merge pull request #12091 from hauntsaninja/strict-optional-glibc
2 parents b88adde + 997f92a commit 4734c4c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

news/5C12428B-09FA-49BC-A886-6F5D8885BC14.trivial.rst

Whitespace-only changes.

src/pip/_internal/utils/glibc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# The following comment should be removed at some point in the future.
2-
# mypy: strict-optional=False
3-
41
import os
52
import sys
63
from typing import Optional, Tuple
@@ -20,8 +17,11 @@ def glibc_version_string_confstr() -> Optional[str]:
2017
if sys.platform == "win32":
2118
return None
2219
try:
20+
gnu_libc_version = os.confstr("CS_GNU_LIBC_VERSION")
21+
if gnu_libc_version is None:
22+
return None
2323
# os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17":
24-
_, version = os.confstr("CS_GNU_LIBC_VERSION").split()
24+
_, version = gnu_libc_version.split()
2525
except (AttributeError, OSError, ValueError):
2626
# os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
2727
return None

0 commit comments

Comments
 (0)