Skip to content

Commit a859e6d

Browse files
committed
Handle --json dict return on conda v4.3
1 parent ddea859 commit a859e6d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

conda.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _check_installed(module, conda, name):
129129
version = None
130130

131131
data = json.loads(stdout)
132-
if data:
132+
if data and type(data[0]) is str:
133133
# At this point data will be a list of len 1, with the element of
134134
# the format: "channel::package-version-py35_1"
135135
line = data[0]
@@ -142,6 +142,11 @@ def _check_installed(module, conda, name):
142142
if pname == name: # verify match for safety
143143
installed = True
144144
version = pversion
145+
elif data and type(data[0]) is dict:
146+
# conda 4.3 now returns a dictionary
147+
if data[0]['name'] == name:
148+
installed = True
149+
version = data[0]['version']
145150

146151
return installed, version
147152

0 commit comments

Comments
 (0)