From 6efdde9f6eeca185aafa7393f6e61fd3aefa1cbe Mon Sep 17 00:00:00 2001 From: Anthony King Date: Mon, 5 May 2014 20:37:05 +0100 Subject: [PATCH] Prevent warning twice about Python 3 usage Only warn about using Python 3 when running the repo script directly. This prevents the user being warned twice. Change-Id: I2ee51ea2fa0127ea310598320e460ec9f38c6488 --- repo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repo b/repo index b8c414be..3fd0166e 100755 --- a/repo +++ b/repo @@ -139,10 +139,6 @@ def _print(*objects, **kwargs): # Python version check ver = sys.version_info -if ver[0] == 3: - _print('warning: Python 3 support is currently experimental. YMMV.\n' - 'Please use Python 2.6 - 2.7 instead.', - file=sys.stderr) if (ver[0], ver[1]) < MIN_PYTHON_VERSION: _print('error: Python version %s unsupported.\n' 'Please use Python 2.6 - 2.7 instead.' @@ -768,4 +764,8 @@ def main(orig_args): if __name__ == '__main__': + if ver[0] == 3: + _print('warning: Python 3 support is currently experimental. YMMV.\n' + 'Please use Python 2.6 - 2.7 instead.', + file=sys.stderr) main(sys.argv[1:])