mirror of
https://github.com/dgelessus/python-rsrcfork.git
synced 2024-12-22 02:29:56 +00:00
Don't pass required=True to add_subparsers
The required kwarg of add_subparsers was only added in Python 3.7, and we currently still support Python 3.6.
This commit is contained in:
parent
a9f54b678c
commit
b01cfc77cf
@ -671,7 +671,7 @@ rsrcfork library, which this tool is a part of.
|
||||
|
||||
subs = ap.add_subparsers(
|
||||
dest="subcommand",
|
||||
required=True,
|
||||
# TODO Add required=True (added in Python 3.7) once we drop Python 3.6 compatibility.
|
||||
metavar="SUBCOMMAND",
|
||||
)
|
||||
|
||||
@ -804,7 +804,11 @@ handle resource compression).
|
||||
|
||||
ns = ap.parse_args()
|
||||
|
||||
if ns.subcommand == "read-header":
|
||||
if ns.subcommand is None:
|
||||
# TODO Remove this branch once we drop Python 3.6 compatibility, because this case will be handled by passing required=True to add_subparsers (see above).
|
||||
print("Missing subcommand", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
elif ns.subcommand == "read-header":
|
||||
do_read_header(ns)
|
||||
elif ns.subcommand == "info":
|
||||
do_info(ns)
|
||||
|
Loading…
Reference in New Issue
Block a user