From c70ff3f24e14e6e2e9e000b12b36970c6290cf12 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Fri, 26 Jan 2024 20:34:49 -0800 Subject: [PATCH] [CI] Only use 'required' for Python >= 3.7 --- build-script-helper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-script-helper.py b/build-script-helper.py index 09013f74..5a037216 100755 --- a/build-script-helper.py +++ b/build-script-helper.py @@ -294,9 +294,10 @@ def add_common_args(parser: argparse.ArgumentParser) -> None: def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(prog="build-script-helper.py") - subparsers = parser.add_subparsers( - title="subcommands", dest="action", required=True, metavar="action" - ) + if sys.version_info >= (3, 7, 0): + subparsers = parser.add_subparsers(title="subcommands", dest="action", required=True, metavar="action") + else: + subparsers = parser.add_subparsers(title="subcommands", dest="action", metavar="action") build_parser = subparsers.add_parser("build", help="build the package") add_common_args(build_parser)