More issues found by ruff

This commit is contained in:
Karolina Surma
2025-02-07 19:52:06 +01:00
parent 706096ef12
commit db55a78169
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ def license_keyword_to_spdx_identifiers(license_keyword: str | None) -> list | N
parsed_license = licensing.parse(license_keyword, validate=True)
# The objects are stored in sets, sort and return as a list
return sorted(parsed_license.objects)
except ExpressionError as err:
except ExpressionError:
# Don't bubble the error up, the calling function will handle the invalid result
return None
+2 -2
View File
@@ -48,8 +48,8 @@ def _get_metadata_file(pypi_pkg_data: dict[Any, Any], session: Session | None =
if entry["packagetype"] == "bdist_wheel":
try:
response = _get_from_url(entry["url"] + ".metadata", error_str, session=session)
except PackageNotFoundError:
raise CoreMetadataNotFoundError(error_str)
except PackageNotFoundError as exc:
raise CoreMetadataNotFoundError(error_str) from exc
return response.text
else:
raise CoreMetadataNotFoundError(error_str)