Skip to content

Fix #9299 (Makefile: tools/matchcompiler.py is executed via Python 2)#2247

Merged
versat merged 1 commit into
cppcheck-opensource:masterfrom
versat:make_matchcompiler_python
Oct 8, 2019
Merged

Fix #9299 (Makefile: tools/matchcompiler.py is executed via Python 2)#2247
versat merged 1 commit into
cppcheck-opensource:masterfrom
versat:make_matchcompiler_python

Conversation

@versat
Copy link
Copy Markdown
Collaborator

@versat versat commented Oct 7, 2019

Check if "python" is available, if not check for "python3" and use
the available Python interpreter. If no Python interpreter is found,
"make" fails with an according error message.
This solves the issue that not all modern Linux distributions any longer
install Python 2 by default, so "python" is not available and
"make MATCHCOMPILER=yes" would fail. Instead of forcing the users to
install Python 2, Python 3 is used in such a case now if it is
available.

Check if "python" is available, if not check for "python3" and use
the available Python interpreter. If no Python interpreter is found,
"make" fails with an according error message.
This solves the issue that not all modern Linux distributions any longer
install Python 2 by default, so "python" is not available and
"make MATCHCOMPILER=yes" would fail. Instead of forcing the users to
install Python 2, Python 3 is used in such a case now if it is
available.
@versat
Copy link
Copy Markdown
Collaborator Author

versat commented Oct 7, 2019

Tested under Debian 10 with only Python 3 ("python3") beeing available and under Cygwin with Python 2 and Python 3 installed.
Travis also has Python 2 and Python 3 installed, so the behavior on Travis should be unchanged.

@versat versat requested a review from danmar October 7, 2019 18:20
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Oct 8, 2019

lgtm. I think it's fine to drop support for python 2 in internal scripts. but well if you can still allow python 2 for a while that is better..

@versat versat merged commit 75e4e70 into cppcheck-opensource:master Oct 8, 2019
@versat versat deleted the make_matchcompiler_python branch October 8, 2019 08:55
jubnzv pushed a commit to jubnzv/cppcheck that referenced this pull request Nov 13, 2019
…cppcheck-opensource#2247)

Check if "python" is available, if not check for "python3" and use
the available Python interpreter. If no Python interpreter is found,
"make" fails with an according error message.
This solves the issue that not all modern Linux distributions any longer
install Python 2 by default, so "python" is not available and
"make MATCHCOMPILER=yes" would fail. Instead of forcing the users to
install Python 2, Python 3 is used in such a case now if it is
available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants