Skip to content

Commit

Permalink
Appply some bugbear suggestions (#761)
Browse files Browse the repository at this point in the history
B015 Pointless comparison.
B009 Do not call `getattr` with a constant attribute value.

---------

Co-authored-by: Brett Cannon <brett@python.org>
  • Loading branch information
DimitriPapadopoulos and brettcannon committed Jan 12, 2024
1 parent 7bcd6d8 commit 57a6a7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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: Optional[str] = os.confstr("CS_GNU_LIBC_VERSION")
assert version_string is not None
_, version = version_string.rsplit()
except (AssertionError, AttributeError, OSError, ValueError):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@


def test_infinity_repr():
repr(Infinity) == "Infinity"
assert repr(Infinity) == "Infinity"


def test_negative_infinity_repr():
repr(NegativeInfinity) == "-Infinity"
assert repr(NegativeInfinity) == "-Infinity"


def test_infinity_hash():
Expand Down

0 comments on commit 57a6a7f

Please sign in to comment.