From 9b0645969560d8317b6b8a26399e2e19648a342a Mon Sep 17 00:00:00 2001 From: Yosif Yosifov Date: Thu, 27 Apr 2017 11:33:21 +0300 Subject: [PATCH] Fix the six package detection in release --- lib/services/doctor-service.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index 0900ee28e0..1b4d5113f3 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -219,17 +219,18 @@ class DoctorService implements IDoctorService { let hasInvalidPackages = false; if (this.$hostInfo.isDarwin) { try { - let queryForSixPackage = await this.$childProcess.exec(`pip freeze | grep '^six=' | wc -l`); - let sixPackagesFoundCount = parseInt(queryForSixPackage); - if (sixPackagesFoundCount === 0) { + await this.$childProcess.exec(`python -c "import six"`); + } catch (error) { + // error.code = 1 so the Python is present, but we don't have six. + if (error.code === 1) { hasInvalidPackages = true; this.$logger.warn("The Python 'six' package not found."); this.$logger.out("This package is required by the Debugger library (LLDB) for iOS. You can install it by running 'pip install six' from the terminal."); + } else { + this.$logger.warn("Couldn't retrieve installed python packages."); + this.$logger.out("We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed."); + this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`); } - } catch (error) { - this.$logger.warn("Couldn't retrieve installed python packages."); - this.$logger.out("We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed."); - this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`); } } return hasInvalidPackages;