From dd1d98d16a87505756a00538c6afa5141145bd46 Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Mon, 18 Feb 2019 14:05:09 +0000 Subject: [PATCH] bisector: disallow importing as __main__ Calling the script directly imports it as __main__, which breaks references to classes expected to be hosted in a module called bisector. That behavior is normal for a python application and handled by a shim created by pip in a PATH location, so bisector needs to be called through it. --- tools/bisector/bisector/bisector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/bisector/bisector/bisector.py b/tools/bisector/bisector/bisector.py index 2de5e763b..7d56864d6 100755 --- a/tools/bisector/bisector/bisector.py +++ b/tools/bisector/bisector/bisector.py @@ -5670,6 +5670,7 @@ def main(argv=sys.argv[1:]): sys.exit(return_code) if __name__ == '__main__': - main() + print('bisector needs to be installed using pip and called through its shim, not executed directly', file=sys.stderr) + sys.exit(2) # vim :set tabstop=4 shiftwidth=4 expandtab textwidth=80 -- GitLab