From 1a022aade5a3e4b790a03101ec458b38bda283ae Mon Sep 17 00:00:00 2001 From: PrajwalM2212 Date: Wed, 28 Aug 2019 21:53:27 +0530 Subject: [PATCH] Wrap python2.7 error message Wraps python2.7 error message with user-friendly error message Resolves https://github.com/vmware/tern/issues/362 Signed-off-by: Prajwal M --- tern/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tern/__main__.py b/tern/__main__.py index 9d550e0c..452af4aa 100755 --- a/tern/__main__.py +++ b/tern/__main__.py @@ -145,7 +145,11 @@ def main(): args = parser.parse_args() # execute - do_main(args) + if sys.version_info < (3, 0): + sys.stderr.write("Error running Tern. Please check that python3 " + "is configured as default.\n") + else: + do_main(args) if __name__ == "__main__":