Skip to content

Commit

Permalink
Fix flake8-bugbear warning
Browse files Browse the repository at this point in the history
B009 Do not call `getattr` with a constant attribute value.
     It is not any safer than normal property access.
  • Loading branch information
DimitriPapadopoulos committed Jan 4, 2024
1 parent 0915fee commit adc20c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/packaging/_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _glibc_version_string_confstr() -> Optional[str]:
# https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183
try:
# Should be a string like "glibc 2.17".
version_string: str = getattr(os, "confstr")("CS_GNU_LIBC_VERSION")
version_string: str = os.confstr("CS_GNU_LIBC_VERSION")
assert version_string is not None
_, version = version_string.rsplit()
except (AssertionError, AttributeError, OSError, ValueError):
Expand Down

0 comments on commit adc20c4

Please sign in to comment.