Ignore harmless error when importing words to the dictionary

This commit is contained in:
Kovid Goyal 2014-04-25 13:02:24 +05:30
parent d1b517357e
commit b51bb174db

View File

@ -255,7 +255,10 @@ class Dictionaries(object):
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