Utilities/__init__.py

changeset 2319
116c547dedce
parent 2302
f29e9405c851
child 2525
8b507a9a2d40
child 2553
2ef00ee163a8
--- a/Utilities/__init__.py	Mon Jan 07 16:34:02 2013 +0100
+++ b/Utilities/__init__.py	Mon Jan 07 17:06:13 2013 +0100
@@ -1502,19 +1502,24 @@
     """
     Module function to check the presence of PySide.
     
-    @return flag indicating the presence of PySide (boolean)
+    @return tuple of two flags indicating the presence of PySide for Python2
+        and PySide for Python3 (boolean, boolean)
     """
+
     try:
         # step 1: try Python3 variant of PySide
         import PySide       # __IGNORE_EXCEPTION__
         del PySide
-        return True
+        py3 = True
     except ImportError:
-        # step 2: check for a Python2 variant
-        interpreter = Preferences.getDebugger("PythonInterpreter")
-        if interpreter == "" or not isinpath(interpreter):
-            return False
-        
+        py3 = False
+    
+    # step 2: check for a Python2 variant
+    interpreter = Preferences.getDebugger("PythonInterpreter")
+    if interpreter == "" or not isinpath(interpreter):
+        py2 = False
+    else:
+        py2 = False
         checker = os.path.join(getConfig('ericDir'),
                                "UtilitiesPython2", "PySideImporter.py")
         args = [checker]
@@ -1524,9 +1529,9 @@
         finished = proc.waitForFinished(30000)
         if finished:
             if proc.exitCode() == 0:
-                return True
+                py2 = True
     
-    return False
+    return py2, py3
 
 ################################################################################
 # Other utility functions below

eric ide

mercurial