From 12aa03917a8c528a1daaa836ab93cb189b530e0b Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sun, 5 Dec 2021 21:19:56 +0100 Subject: [PATCH] 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 --- lib/bup/index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.39.2