Commit c082b52f authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

If the debian.deb822 module raises any exception on import, re-raise it as an...

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: #300)
parent 0c124437
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2014-2015 Jérémy Bobbio <lunar@debian.org>
# Copyright © 2015-2021 Chris Lamb <lamby@debian.org>
# Copyright © 2015-2022 Chris Lamb <lamby@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

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