Skip to content

Commit 27b6d60

Browse files
authored
Fix the six package detection in release (#2748)
1 parent d95e9eb commit 27b6d60

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/services/doctor-service.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,18 @@ class DoctorService implements IDoctorService {
219219
let hasInvalidPackages = false;
220220
if (this.$hostInfo.isDarwin) {
221221
try {
222-
let queryForSixPackage = await this.$childProcess.exec(`pip freeze | grep '^six=' | wc -l`);
223-
let sixPackagesFoundCount = parseInt(queryForSixPackage);
224-
if (sixPackagesFoundCount === 0) {
222+
await this.$childProcess.exec(`python -c "import six"`);
223+
} catch (error) {
224+
// error.code = 1 so the Python is present, but we don't have six.
225+
if (error.code === 1) {
225226
hasInvalidPackages = true;
226227
this.$logger.warn("The Python 'six' package not found.");
227228
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.");
229+
} else {
230+
this.$logger.warn("Couldn't retrieve installed python packages.");
231+
this.$logger.out("We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed.");
232+
this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`);
228233
}
229-
} catch (error) {
230-
this.$logger.warn("Couldn't retrieve installed python packages.");
231-
this.$logger.out("We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed.");
232-
this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`);
233234
}
234235
}
235236
return hasInvalidPackages;

0 commit comments

Comments
 (0)