Repository: mesos Updated Branches: refs/heads/master a83a25203 -> 30e7429c8
Changed python3 support check script to print to `stderr`. The scripts this might be used in might use `stdout` to report results we do not intend to interfere with, e.g., `support/apply-reviews.py` can print commands to execute in dry run mode. This patch makes the check script print to `stderr` instead of `stdout`. Review: https://reviews.apache.org/r/67348/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/30e7429c Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/30e7429c Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/30e7429c Branch: refs/heads/master Commit: 30e7429c85f743384f83454eb29b14fe3efe3c39 Parents: a83a252 Author: Benjamin Bannier <[email protected]> Authored: Tue May 29 10:16:13 2018 +0200 Committer: Benjamin Bannier <[email protected]> Committed: Tue May 29 10:16:13 2018 +0200 ---------------------------------------------------------------------- support/check-python3.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/30e7429c/support/check-python3.py ---------------------------------------------------------------------- diff --git a/support/check-python3.py b/support/check-python3.py index 08252d8..898e543 100644 --- a/support/check-python3.py +++ b/support/check-python3.py @@ -20,24 +20,28 @@ Checks if Python 3.6 is available on the machine. """ # pylint: disable=superfluous-parens +from __future__ import print_function + import os import subprocess import sys +def _print(message): + print(message, file=sys.stderr) def print_error(): """Prints a warning requesting to install Python 3.6.""" - print("The support scripts will be upgraded to Python 3 by July 1st.") - print("Make sure to install Python 3.6 on your machine before.") + _print("The support scripts will be upgraded to Python 3 by July 1st.") + _print("Make sure to install Python 3.6 on your machine before.") def print_warning(): """Prints a warning requesting to use the Python 3 scripts.""" - print("Congratulations! You have Python 3 installed correctly.") - print("Please start using the scripts in `support/python3`.") + _print("Congratulations! You have Python 3 installed correctly.") + _print("Please start using the scripts in `support/python3`.") # NOTE: This is only either unset, or set to 3. if "MESOS_SUPPORT_PYTHON" not in os.environ: - print("Please also set the environment variable `MESOS_SUPPORT_PYTHON` to `3`") - print("so that the Git hooks use the Python 3 scripts.") + _print("Please also set the environment variable `MESOS_SUPPORT_PYTHON` to `3`") + _print("so that the Git hooks use the Python 3 scripts.") if sys.version_info[0] < 3: # On Windows, system-wide installations of Python 3.6 gives a tools called
