Skip to content

Commit 691bbbd

Browse files
authored
Use < 3.7 compatible API for marking subparsers as required (#5657)
`required` was only added as a parameter to `add_subparsers` in Python 3.7. Explicitly set `required` on `subparsers` after instead, which is supported on all versions.
1 parent eb70cf3 commit 691bbbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Utilities/bootstrap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def main():
3737
This script will build a bootstrapped copy of the Swift Package Manager, and optionally perform extra
3838
actions like installing the result (with 'install') to a location ('--prefix').
3939
""")
40-
subparsers = parser.add_subparsers(dest='command', required=True)
40+
subparsers = parser.add_subparsers(dest='command')
41+
subparsers.required = True
4142

4243
# clean
4344
parser_clean = subparsers.add_parser("clean", help="cleans build artifacts")

0 commit comments

Comments
 (0)