QScintilla/Editor.py

changeset 2900
04a13651238e
parent 2768
eab35f6e709f
child 2904
1da821da961e
--- a/QScintilla/Editor.py	Mon Sep 09 20:04:19 2013 +0200
+++ b/QScintilla/Editor.py	Tue Sep 10 18:50:19 2013 +0200
@@ -1407,10 +1407,10 @@
         if not language:
             ext = os.path.splitext(filename)[1]
             if ext in [".py", ".pyw"]:
-                if self.isPy2File():
+                if self.isPy3File():
+                    language = "Python3"
+                elif self.isPy2File():
                     language = "Python2"
-                elif self.isPy3File():
-                    language = "Python3"
                 else:
                     # default is Python 3
                     language = "Python3"
@@ -1529,10 +1529,10 @@
         filename = os.path.basename(filename)
         apiLanguage = Preferences.getEditorLexerAssoc(filename)
         if apiLanguage == "":
-            if self.isPy2File():
+            if self.isPy3File():
+                apiLanguage = "Python3"
+            elif self.isPy2File():
                 apiLanguage = "Python2"
-            elif self.isPy3File():
-                apiLanguage = "Python3"
             elif self.isRubyFile():
                 apiLanguage = "Ruby"
         
@@ -1660,10 +1660,10 @@
         if not ftype:
             ftype = self.getFileTypeByFlag()
         if not ftype:
-            if self.isPy2File():
+            if self.isPy3File():
+                ftype = "Python3"
+            elif self.isPy2File():
                 ftype = "Python2"
-            elif self.isPy3File():
-                ftype = "Python3"
             elif self.isRubyFile():
                 ftype = "Ruby"
             else:

eric ide

mercurial