pythondistdeps.py: Catch all exceptions and terminate build if one is raised
This commit is contained in:
parent
27d363833e
commit
cc489bde7a
@ -1,7 +1,7 @@
|
||||
Name: python-rpm-generators
|
||||
Summary: Dependency generators for Python RPMs
|
||||
Version: 12
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
|
||||
# Originally all those files were part of RPM, so license is kept here
|
||||
License: GPLv2+
|
||||
@ -47,6 +47,10 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} *.py
|
||||
%{_rpmconfigdir}/pythonbundles.py
|
||||
|
||||
%changelog
|
||||
* Tue May 25 2021 Tomas Orsava <torsava@redhat.com> - 12-7
|
||||
- pythondistdeps.py: Detect missing or corrupted metadata
|
||||
- pythondistdeps.py: Catch all exceptions and terminate the build if one is raised
|
||||
|
||||
* Mon Apr 19 2021 Miro Hrončok <mhroncok@redhat.com> - 12-6
|
||||
- Get rid of distutils deprecation warning (by not using it)
|
||||
- The distutils module is deprecated in Python 3.10+
|
||||
|
@ -260,10 +260,10 @@ def get_marker_env(dist, extra):
|
||||
"extra": extra}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
"""To allow this script to be importable (and its classes/functions
|
||||
reused), actions are performed only when run as a main script."""
|
||||
|
||||
reused), actions are defined in the main function and are performed only
|
||||
when run as a main script."""
|
||||
parser = argparse.ArgumentParser(prog=argv[0])
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument('-P', '--provides', action='store_true', help='Print Provides')
|
||||
@ -552,3 +552,14 @@ if __name__ == "__main__":
|
||||
else:
|
||||
# Print out unversioned provides, requires, recommends, conflicts
|
||||
print(name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
"""To allow this script to be importable (and its classes/functions
|
||||
reused), actions are performed only when run as a main script."""
|
||||
try:
|
||||
main()
|
||||
except Exception as exc:
|
||||
print("*** PYTHONDISTDEPS_GENERATORS_FAILED ***", flush=True)
|
||||
raise RuntimeError("Error: pythondistdeps.py generator encountered an unhandled exception and was terminated.") from exc
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user