From: Johannes Berg Date: Sun, 5 Dec 2021 20:19:56 +0000 (+0100) Subject: index.Reader.filter: throw when parent's missing (don't assert) X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=commitdiff_plain;h=12aa03917a8c528a1daaa836ab93cb189b530e0b index.Reader.filter: throw when parent's missing (don't assert) ...since we're planning to make the tests fail on assertion failures. Signed-off-by: Johannes Berg Reviewed-by: Rob Browning [rlb@defaultvalue.org: adjust commit message] Tested-by: Rob Browning --- diff --git a/lib/bup/index.py b/lib/bup/index.py index 591079a..3b98892 100644 --- a/lib/bup/index.py +++ b/lib/bup/index.py @@ -522,7 +522,8 @@ class Reader: # Otherwise something like "save x/y" will produce # nothing if x is up to date. pe = self.find(rp) - assert(pe) + if not pe: + raise Exception("cannot find %r" % rp) name = path + pe.name[len(rp):] yield (name, pe)