Commit 1dc8c79e authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Don't crash if we encounter an .rdb file without an equivalent .rdx file. (Closes: Debian:#1066991)

parent fc8fba68
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -96,12 +96,20 @@ def get_module_path_for_rdb(rdb, temp_dir, module_name):
    rdx_name = "{}.rdx".format(os.path.splitext(rdb.name)[0])

    # Query the container for the full path (eg. `./path/to/foo.rdx`)...
    try:
        rdx = rdb.container.get_member(rdx_name)
    except KeyError:
        # There is no guarantee that the equivalent .rdx file exists.
        # (see Debian:#1066991)
        return None

    if not os.path.exists(rdx.path):
        # ... falling back to looking in the same directory for when
        # comparing two .rdb files directly
        try:
            rdx = rdb.container.get_member(os.path.basename(rdx_name))
        except KeyError:
            return None

    if not os.path.exists(rdx.path):
        # Corresponding .rdx does not exist