mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-10 08:52:39 +01:00
Improve error if python can't run pep8
Summary: On systems with an ancient version of python, the pep8 linter won't run. Instead of blowing up in the user's face, we should display a nice error message. Test Plan: Put /usr/bin (where the ancient version of python is) at the beginning of my path and tried to lint some python. I got a nice error instead of a stack trace. Reviewers: epriestley, wez Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5356
This commit is contained in:
parent
337f7f83ea
commit
30e12a0c9a
1 changed files with 7 additions and 0 deletions
|
@ -74,6 +74,13 @@ final class ArcanistPEP8Linter extends ArcanistFutureLinter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list(, $stderr) = execx('/usr/bin/env python -V');
|
||||||
|
if ($stderr < 'Python 2.5') {
|
||||||
|
throw new ArcanistUsageException(
|
||||||
|
"Python 2.5 or greater is required to run the PEP8 Python linter, but ".
|
||||||
|
rtrim($stderr)." was found instead.");
|
||||||
|
}
|
||||||
|
|
||||||
return $bin;
|
return $bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue