Skip to content
Snippets Groups Projects
Commit 1dc8c79e authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

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

parent fc8fba68
No related branches found
No related tags found
No related merge requests found
......@@ -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`)...
rdx = rdb.container.get_member(rdx_name)
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
rdx = rdb.container.get_member(os.path.basename(rdx_name))
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment