mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-20 02:16:18 +01:00
Ignore harmless error when importing words to the dictionary
This commit is contained in:
parent
d1b517357e
commit
b51bb174db
1 changed files with 4 additions and 1 deletions
|
|
@ -255,7 +255,10 @@ def add_to_user_dictionary(self, name, word, locale):
|
|||
ud.words.add((word, locale.langcode))
|
||||
if len(ud.words) > wl:
|
||||
self.save_user_dictionaries()
|
||||
self.word_cache.pop((word, locale), None)
|
||||
try:
|
||||
self.word_cache.pop((word, locale), None)
|
||||
except TypeError:
|
||||
pass # word is a set, ignore
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue