--- a/eric6/Preferences/__init__.py Wed Apr 21 17:56:12 2021 +0200 +++ b/eric6/Preferences/__init__.py Wed Apr 21 19:40:50 2021 +0200 @@ -2318,10 +2318,7 @@ editorLexerAssoc[key] = editorLexerAssocDefaults[key] else: for key in keyList: - if key in editorLexerAssocDefaults: - defaultValue = editorLexerAssocDefaults[key] - else: - defaultValue = "" + defaultValue = editorLexerAssocDefaults.get(key, "") editorLexerAssoc[key] = prefClass.settings.value( "Editor/LexerAssociations/" + key, defaultValue)