Fix pip3 validation (#11788)

don't error when pip is missing
This commit is contained in:
Tony Murray
2020-06-08 08:11:53 -05:00
committed by GitHub
parent 35b4e1459e
commit 224e191f14

View File

@@ -66,7 +66,7 @@ class Python extends BaseValidation
preg_match('/\(python ([0-9.]+)\)/', `pip3 --version`, $matches); preg_match('/\(python ([0-9.]+)\)/', `pip3 --version`, $matches);
$pip = $matches[1]; $pip = $matches[1];
$python = implode('.', array_slice(explode('.', $version), 0, 2)); $python = implode('.', array_slice(explode('.', $version), 0, 2));
if (version_compare($python, $pip, '!=')) { if ($pip && version_compare($python, $pip, '!=')) {
$validator->fail("python3 ($python) and pip3 ($pip) versions do not match. This likely will cause dependencies to be installed for the wrong python version."); $validator->fail("python3 ($python) and pip3 ($pip) versions do not match. This likely will cause dependencies to be installed for the wrong python version.");
} }
} }