Skip to content

Commit 54be97e

Browse files
committed
Use strict optional checking in glibc
Suggested by pradyunsg in #11374 `--no-strict-optional` defeats half the purpose of using mypy. This change is trivial, we already catch AttributeError in the case that mypy is concerned about.
1 parent 5190ef7 commit 54be97e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/pip/_internal/utils/glibc.py

Lines changed: 1 addition & 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
@@ -21,7 +18,7 @@ def glibc_version_string_confstr() -> Optional[str]:
2118
return None
2219
try:
2320
# os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17":
24-
_, version = os.confstr("CS_GNU_LIBC_VERSION").split()
21+
_, version = os.confstr("CS_GNU_LIBC_VERSION").split() # type: ignore[union-attr]
2522
except (AttributeError, OSError, ValueError):
2623
# os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
2724
return None

0 commit comments

Comments
 (0)