Skip to content

Commit c5ce71e

Browse files
committed
cli: Drop argparse 3.9 compatibility test.
The project requires 3.10, so no need to support < 3.9 here.
1 parent a657fd1 commit c5ce71e

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

pybricksdev/cli/__init__.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -147,27 +147,12 @@ def add_parser(self, subparsers: argparse._SubParsersAction):
147147
"serial port name for USB connection",
148148
)
149149

150-
if hasattr(argparse, "BooleanOptionalAction"):
151-
# BooleanOptionalAction requires Python 3.9
152-
parser.add_argument(
153-
"--wait",
154-
help="wait for the program to complete before disconnecting",
155-
action=argparse.BooleanOptionalAction,
156-
default=True,
157-
)
158-
else:
159-
parser.add_argument(
160-
"--wait",
161-
help="wait for the program to complete before disconnecting (default)",
162-
action="store_true",
163-
default=True,
164-
)
165-
parser.add_argument(
166-
"--no-wait",
167-
help="disconnect as soon as program is done downloading",
168-
action="store_false",
169-
dest="wait",
170-
)
150+
parser.add_argument(
151+
"--wait",
152+
help="wait for the program to complete before disconnecting",
153+
action=argparse.BooleanOptionalAction,
154+
default=True,
155+
)
171156

172157
async def run(self, args: argparse.Namespace):
173158

0 commit comments

Comments
 (0)