Skip to content

Commit 1aab192

Browse files
bottlerfacebook-github-bot
authored andcommitted
Linter when only python3 exists
Reviewed By: nikhilaravi Differential Revision: D31289856 fbshipit-source-id: 5a522a69537a873bacacf2a178e5f30771aef35f
1 parent dd76b41 commit 1aab192

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dev/linter.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
{
1111
V=$(black --version|cut '-d ' -f3)
1212
code='import distutils.version; assert "19.3" < distutils.version.LooseVersion("'$V'")'
13-
python -c "${code}" 2> /dev/null
13+
PYTHON=false
14+
command -v python > /dev/null && PYTHON=python
15+
command -v python3 > /dev/null && PYTHON=python3
16+
${PYTHON} -c "${code}" 2> /dev/null
1417
} || {
1518
echo "Linter requires black 19.3b0 or higher!"
1619
exit 1

0 commit comments

Comments
 (0)