diff -r ef803911f553 -r 8bc578136279 QScintilla/Editor.py --- a/QScintilla/Editor.py Tue Mar 10 20:20:46 2015 +0100 +++ b/QScintilla/Editor.py Wed Mar 11 18:25:37 2015 +0100 @@ -1508,7 +1508,8 @@ language = Preferences.getEditorLexerAssoc(basename) if not language: bindName = self.__bindName(self.text(0)) - language = Preferences.getEditorLexerAssoc(bindName) + if bindName: + language = Preferences.getEditorLexerAssoc(bindName) if language == "Python": # correction for Python pyVer = Utilities.determinePythonVersion(