Fixed an issue on Windows in the APIs manager when a lexer return None.

Tue, 19 Nov 2013 20:00:21 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 19 Nov 2013 20:00:21 +0100
changeset 3096
23856c207f81
parent 3095
72938a6d5047
child 3098
02ee75d31584

Fixed an issue on Windows in the APIs manager when a lexer return None.

QScintilla/APIsManager.py file | annotate | diff | comparison | revisions
--- a/QScintilla/APIsManager.py	Sun Nov 17 15:07:56 2013 +0100
+++ b/QScintilla/APIsManager.py	Tue Nov 19 20:00:21 2013 +0100
@@ -183,14 +183,17 @@
                     Globals.getPyQt4ModulesDirectory(), "qsci")
                 if os.path.exists(qsciPath):
                     # it's the installer
-                    apidir = os.path.join(qsciPath, "api",
-                                          self.__lexer.lexer())
-                    fnames = []
-                    filist = QDir(apidir).entryInfoList(["*.api"], QDir.Files,
-                                                        QDir.IgnoreCase)
-                    for fi in filist:
-                        fnames.append(fi.absoluteFilePath())
-                    return fnames
+                    if self.__lexer.lexer() is not None:
+                        apidir = os.path.join(qsciPath, "api",
+                                              self.__lexer.lexer())
+                        fnames = []
+                        filist = QDir(apidir).entryInfoList(
+                            ["*.api"], QDir.Files, QDir.IgnoreCase)
+                        for fi in filist:
+                            fnames.append(fi.absoluteFilePath())
+                        return fnames
+                    else:
+                        return []
             
             return self.__apis.installedAPIFiles()
         else:

eric ide

mercurial