eric6/CondaInterface/__init__.py

changeset 7093
5b6c7e9f875d
parent 6942
2602857055c5
child 7192
a22eee00b052
--- a/eric6/CondaInterface/__init__.py	Sat Jul 20 15:34:31 2019 +0200
+++ b/eric6/CondaInterface/__init__.py	Sun Jul 28 11:26:37 2019 +0200
@@ -58,17 +58,23 @@
                     '<conda returned invalid data.>')
                 return
             
-            __CondaVersionStr = jsonDict["conda_version"]
-            __CondaVersion = tuple(
-                int(i) for i in __CondaVersionStr.split(".")
-            )
-            __CondaRootPrefix = jsonDict["root_prefix"]
-            if "user_rc_path" in jsonDict:
-                __CondaUserConfig = jsonDict["user_rc_path"]
-            elif "rc_path" in jsonDict:
-                __CondaUserConfig = jsonDict["rc_path"]
-            
-            __initialized = True
+            if "error" in jsonDict:
+                __CondaVersionStr = QCoreApplication.translate(
+                    "CondaInterface",
+                    '<conda returned an error: {0}.>').format(
+                    jsonDict["error"])
+            else:
+                __CondaVersionStr = jsonDict["conda_version"]
+                __CondaVersion = tuple(
+                    int(i) for i in __CondaVersionStr.split(".")
+                )
+                __CondaRootPrefix = jsonDict["root_prefix"]
+                if "user_rc_path" in jsonDict:
+                    __CondaUserConfig = jsonDict["user_rc_path"]
+                elif "rc_path" in jsonDict:
+                    __CondaUserConfig = jsonDict["rc_path"]
+                
+                __initialized = True
 
 
 def condaVersion():

eric ide

mercurial