Skip to content

Commit

Permalink
search-notes.py: Bug fix for "RuntimeError: dictionary changed size d…
Browse files Browse the repository at this point in the history
…uring iteration"
  • Loading branch information
xolox committed Nov 24, 2011
1 parent 8a79a22 commit 10d6e24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion misc/notes/search-notes.py
Expand Up @@ -117,13 +117,14 @@ def update_index(self):
self.add_note(filename, last_modified)
else:
# Check for updated and/or deleted notes since the last run.
for filename, last_modified_in_db in self.index['files'].iteritems():
for filename in self.index['files'].keys():
if filename not in notes_on_disk:
# Forget a deleted note.
self.delete_note(filename)
else:
# Check whether previously seen note has changed?
last_modified_on_disk = notes_on_disk[filename]
last_modified_in_db = self.index['files'][filename]
if last_modified_on_disk > last_modified_in_db:
self.delete_note(filename)
self.add_note(filename, last_modified_on_disk)
Expand Down

0 comments on commit 10d6e24

Please sign in to comment.