]> arthur.barton.de Git - bup.git/commitdiff
index.Reader.filter: throw when parent's missing (don't assert)
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 5 Dec 2021 20:19:56 +0000 (21:19 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 19 Dec 2021 19:03:48 +0000 (13:03 -0600)
...since we're planning to make the tests fail on assertion failures.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: adjust commit message]
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/index.py

index 591079a7b59b2963b47692cfe9ef40d6277c103b..3b98892b41b6b223bf74c9d4c5779439b718376f 100644 (file)
@@ -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)