packaging
packaging copied to clipboard
Apply ruff/bugbear rules (B)
B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/
B018 Found useless expression. Either assign it to a variable or remove it.
https://docs.astral.sh/ruff/rules/useless-expression/
Also, do not ignore ruff/bugbear rule B015 and B009: https://docs.astral.sh/ruff/rules/useless-comparison/ https://docs.astral.sh/ruff/rules/get-attr-with-constant/