Skip to content

Commit 4196270

Browse files
committed
Make anydbm indexer handle missing items the same as rdbms backend
The anydbm Class::index() method was capturing the IndexError rather than letting it bubble up. This is different from the rdbms backends. In implementing batch/incremental indexing via roundup-admin, I wanted to report any missing items that were specified in the batch. This worked by capturing the IndexError. It worked with rdbms backends but not anydbm. This change makes it work with anydbm as well. Focused testing doesn't show any regressions, so committing the change.
1 parent 1e9c8df commit 4196270

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

roundup/backends/back_anydbm.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,12 +2070,8 @@ def index(self, nodeid):
20702070
for prop, propclass in self.getprops().items():
20712071
if isinstance(propclass, hyperdb.String) and propclass.indexme:
20722072
# index them under (classname, nodeid, property)
2073-
try:
2074-
value = str(self.get(nodeid, prop))
2075-
except IndexError:
2076-
# node has been destroyed
2077-
continue
2078-
self.db.indexer.add_text((self.classname, nodeid, prop), value)
2073+
self.db.indexer.add_text((self.classname, nodeid, prop),
2074+
str(self.get(nodeid, prop)))
20792075

20802076
#
20812077
# import / export support

0 commit comments

Comments
 (0)