Skip to content

Commit 664e9d8

Browse files
committed
direct types
1 parent 7f06e65 commit 664e9d8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tools/mkbuildoptglobals.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def extract_build_opt(name: str, dst: TextIO, src: TextIO):
209209
IN_SKIP_OPT = 3
210210

211211
state = IN_RAW
212-
block = [] # type: List[str]
212+
block: List[str] = []
213213

214214
for n, raw_line in enumerate(src, start=1):
215215
line = raw_line.strip().rstrip()
@@ -538,9 +538,7 @@ def main_build(args: argparse.Namespace):
538538
return
539539

540540
# when debug port is used, allow for a different set of command line options
541-
build_debug = args.build_debug or "DEBUG_SERIAL_PORT" in (
542-
args.D or []
543-
) # type: bool
541+
build_debug: bool = args.build_debug or "DEBUG_SERIAL_PORT" in (args.D or [])
544542
name = make_build_opt_name(ctx, build_debug)
545543

546544
# options file is not written immediately, buffer its contents before commiting
@@ -578,7 +576,7 @@ def main_build(args: argparse.Namespace):
578576

579577

580578
def main_inspect(args: argparse.Namespace):
581-
p = args.path # type: pathlib.Path
579+
p: pathlib.Path = args.path
582580

583581
buffer = io.StringIO()
584582
try:
@@ -590,13 +588,13 @@ def main_inspect(args: argparse.Namespace):
590588

591589

592590
def main_placeholder(args: argparse.Namespace):
593-
paths = args.path # type: List[pathlib.Path]
591+
paths: List[pathlib.Path] = args.path
594592
ensure_exists_and_empty(*paths)
595593

596594

597595
def main_synchronize(args: argparse.Namespace):
598-
first = args.first # type: pathlib.Path
599-
rest = args.rest # type: List[pathlib.Path]
596+
first: pathlib.Path = args.first
597+
rest: List[pathlib.Path] = args.rest
600598
synchronize_utime(first, *rest)
601599

602600

0 commit comments

Comments
 (0)