[Git][reproducible-builds/diffoscope][master] If the debian.deb822 module raises any exception on import, re-raise it as an...

Chris Lamb (@lamby) gitlab at salsa.debian.org
Fri Jan 21 16:34:10 UTC 2022



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
c082b52f by Chris Lamb at 2022-01-21T08:33:17-08:00
If the debian.deb822 module raises any exception on import, re-raise it as an ImportError. This should fix diffoscope on some Fedora systems. (Closes: reproducible-builds/diffoscope#300)

- - - - -


1 changed file:

- diffoscope/comparators/debian.py


Changes:

=====================================
diffoscope/comparators/debian.py
=====================================
@@ -2,7 +2,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright © 2014-2015 Jérémy Bobbio <lunar at debian.org>
-# Copyright © 2015-2021 Chris Lamb <lamby at debian.org>
+# Copyright © 2015-2022 Chris Lamb <lamby at debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,7 +21,13 @@ import re
 import os.path
 import logging
 
-from debian.deb822 import Dsc, Deb822
+try:
+    from debian.deb822 import Dsc, Deb822
+except:
+    # Import can fail due to apt_pkg.Error (or similar) tracebacks, but let us
+    # re-raise them as ImportErrors so that the Comparator module class
+    # handling just works. (See reproducible-builds/diffoscope#300)
+    raise ImportError
 
 from diffoscope.changes import Changes
 from diffoscope.changes import ChangesFileException



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/c082b52f17d96676f9bb6f6d71333ae3c687057d

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/c082b52f17d96676f9bb6f6d71333ae3c687057d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20220121/65763fc2/attachment.htm>


More information about the rb-commits mailing list