Globals/__init__.py

branch
Py2 comp.
changeset 2573
71837b5366d5
parent 2525
8b507a9a2d40
child 2677
3d4277929fb3
diff -r dc6d76ab5d10 -r 71837b5366d5 Globals/__init__.py
--- a/Globals/__init__.py	Wed Apr 10 22:21:27 2013 +0200
+++ b/Globals/__init__.py	Wed Apr 10 22:33:47 2013 +0200
@@ -148,19 +148,24 @@
 
 
 ################################################################################
-## functions for searching a Python2 interpreter
+## functions for searching a Python2/3 interpreter
 ################################################################################
 
 
-def findPython2Interpreters():
+def findPythonInterpreters(pyVersion):
     """
-    Module function for searching a Python2 interpreter.
+    Module function for searching a Python interpreter.
     
+    @param pyVersion major Python version
     @return list of interpreters found (list of strings)
     """
-    winPathList = ["C:\\Python25", "C:\\Python26", "C:\\Python27", "C:\\Python28"]
+    if pyVersion == 2:
+        winPathList = ["C:\\Python25", "C:\\Python26", "C:\\Python27", "C:\\Python28"]
+        posixVersionsList = ["2.5", "2.6", "2.7", "2.8"]
+    else:
+        winPathList = ["C:\\Python3{0}".format(x) for x in range(5)]
+        posixVersionsList = ["3.{0}".format(x) for x in range(5)]
     posixPathList = ["/usr/bin", "/usr/local/bin"]
-    posixVersionsList = ["2.5", "2.6", "2.7", "2.8"]
     
     interpreters = []
     if isWindowsPlatform():

eric ide

mercurial