From 0ca29bb33761e8a17e65ec4f2424edc1dfe3d927 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Wed, 13 Jun 2018 08:54:50 +0100 Subject: [PATCH] fw/entrypoint: make command mandatory for Python 3 Python 3 has changed the behavior of subparsers so that they are no longer mandatory by default. As a result, executing just "wa" under Python 3 results in a random error, rather than a help message. Fix this by making the subparsers mandatory. --- wa/framework/entrypoint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wa/framework/entrypoint.py b/wa/framework/entrypoint.py index c19989e1..1164daa8 100644 --- a/wa/framework/entrypoint.py +++ b/wa/framework/entrypoint.py @@ -101,7 +101,9 @@ def main(): logger.debug('Command Line: {}'.format(' '.join(sys.argv))) # each command will add its own subparser - commands = load_commands(parser.add_subparsers(dest='command')) + subparsers = parser.add_subparsers(dest='command') + subparsers.required = True + commands = load_commands(subparsers) args = parser.parse_args(argv) config = ConfigManager()