From 3a77958b7820a30e1edb816b97c7872ae0de3631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Wed, 24 May 2006 22:55:58 +0000 Subject: [PATCH] * be on the safe side, tho' doesn't matter too much --- pisi/search/invertedindex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pisi/search/invertedindex.py b/pisi/search/invertedindex.py index 482b3d46..d054a2c8 100644 --- a/pisi/search/invertedindex.py +++ b/pisi/search/invertedindex.py @@ -78,6 +78,7 @@ class InvertedIndex(object): for term_i in terms: term_i = shelve.LockedDBShelf.encodekey(term_i) term_i_docs = self.get_term(term_i,repo=repo, txn=txn) - term_i_docs.remove(doc) + if doc in term_i_docs: + term_i_docs.remove(doc) self.d.add_item(term_i, term_i_docs, repo=repo, txn=txn) # update return self.d.txn_proc(f, txn)