eric6/Utilities/__init__.py

changeset 7637
c878e8255972
parent 7636
61566f35ab22
child 7725
2648f2c894df
diff -r 61566f35ab22 -r c878e8255972 eric6/Utilities/__init__.py
--- a/eric6/Utilities/__init__.py	Mon Jun 22 17:55:06 2020 +0200
+++ b/eric6/Utilities/__init__.py	Tue Jun 23 17:24:18 2020 +0200
@@ -1622,7 +1622,6 @@
             source = readEncodedFile(filename)[0]
         flags = extractFlags(source)
         ext = os.path.splitext(filename)[1]
-        py2Ext = Preferences.getPython("PythonExtensions")
         py3Ext = Preferences.getPython("Python3Extensions")
         project = e5App().getObject('Project')
         basename = os.path.basename(filename)
@@ -1642,11 +1641,9 @@
         elif (Preferences.getProject("DeterminePyFromProject") and
               project.isOpen() and
               project.isProjectFile(filename) and
-              ext in py2Ext + py3Ext):
+              ext in py3Ext):
             pyVer = pyAssignment.get(project.getProjectLanguage(), 0)
-        elif ext in py2Ext and ext not in py3Ext:
-            pyVer = 2
-        elif ext in py3Ext and ext not in py2Ext:
+        elif ext in py3Ext:
             pyVer = 3
         elif source:
             if isinstance(source, str):
@@ -1657,10 +1654,10 @@
                 if "python3" in line0:
                     pyVer = 3
                 elif "python" in line0:
-                    pyVer = 2
+                    pyVer = 3
         
-        if pyVer == 0 and ext in py2Ext + py3Ext:
-            pyVer = sys.version_info[0]
+        if pyVer == 0 and ext in py3Ext:
+            pyVer = 3
     
     return pyVer
 

eric ide

mercurial