Avoid DeprecationWarning: Implicit None on return values is deprecated and will raise KeyErrors
The warning only happened on corrupted metadata.
The warning originates in 880a6219a1
This commit is contained in:
parent
8fe27ad070
commit
52372a464c
@ -1,7 +1,7 @@
|
|||||||
Name: python-rpm-generators
|
Name: python-rpm-generators
|
||||||
Summary: Dependency generators for Python RPMs
|
Summary: Dependency generators for Python RPMs
|
||||||
Version: 14
|
Version: 14
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
|
|
||||||
Url: https://src.fedoraproject.org/rpms/python-rpm-generators
|
Url: https://src.fedoraproject.org/rpms/python-rpm-generators
|
||||||
|
|
||||||
@ -56,6 +56,9 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} *.py
|
|||||||
%{_rpmconfigdir}/pythonbundles.py
|
%{_rpmconfigdir}/pythonbundles.py
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Oct 03 2023 Miro Hrončok <mhroncok@redhat.com> - 14-8
|
||||||
|
- Avoid DeprecationWarning: Implicit None on return values is deprecated and will raise KeyErrors
|
||||||
|
|
||||||
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 14-7
|
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 14-7
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
|
@ -94,8 +94,8 @@ class Distribution(PathDistribution):
|
|||||||
# that it works also on previous Python/importlib_metadata versions.
|
# that it works also on previous Python/importlib_metadata versions.
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the 'Name' metadata for the distribution package."""
|
"""Return the 'Name' metadata for the distribution package or None."""
|
||||||
return self.metadata['Name']
|
return self.metadata.get('Name')
|
||||||
|
|
||||||
def _parse_py_version(self, path):
|
def _parse_py_version(self, path):
|
||||||
# Try to parse the Python version from the path the metadata
|
# Try to parse the Python version from the path the metadata
|
||||||
|
Loading…
Reference in New Issue
Block a user