mirror of
https://github.com/danieldemus/pyp2spec.git
synced 2026-07-27 21:00:37 +02:00
More issues found by ruff
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user