From eb92baae644316a39b5a2bfcbc81da4b3ec30570 Mon Sep 17 00:00:00 2001 From: Christopher Tomkins-Tinch Date: Tue, 17 Jan 2017 17:56:41 -0500 Subject: [PATCH] add conda package version checking for newer conda versions newer versions of conda report version differently via their JSON API, so we should check for the type after json decoding --- tools/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/__init__.py b/tools/__init__.py index 778fece08..004a49cc7 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -475,7 +475,10 @@ def get_installed_version(self): return # return rather than raise so we can fall back to the next install method if data and len(data): - installed_package_string = data[0] + if isinstance(data[0], dict): + installed_package_string = data[0]["dist_name"] + else: + installed_package_string = data[0] package_info_re = re.compile(r"(?P.*)-(?P.*)-(?P.*)") matches = package_info_re.match(installed_package_string) if matches: