From 4d3095ab91ab6c95ba169cbe8f4f15792e94bd57 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 15 Jan 2019 10:09:09 -0500 Subject: [PATCH] Make bin/pyodide display help rather than crash --- pyodide_build/__main__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 pyodide_build/__main__.py diff --git a/pyodide_build/__main__.py b/pyodide_build/__main__.py old mode 100644 new mode 100755 index a55a5173a..ab8ad9543 --- a/pyodide_build/__main__.py +++ b/pyodide_build/__main__.py @@ -19,8 +19,11 @@ def main(): parser.set_defaults(func=module.main) args = main_parser.parse_args() - # run the selected action - args.func(args) + if hasattr(args, 'func'): + # run the selected action + args.func(args) + else: + main_parser.print_help() if __name__ == '__main__':