Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed committed Jan 4, 2025
1 parent 578a26c commit 23633c6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions milc/milc.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,11 @@ def merge_args_into_config(self) -> None:
if argument in ('subparsers', 'entrypoint'):
continue

# Find the argument's section
if argument in self.default_arguments['general']:
section = 'general'
else:
# Find the argument's section. This is backwards because mypy is sticking its nose where it doesn't belong.
if argument not in self.default_arguments['general']:
section = subcommand_name
else:
section = 'general'

if argument not in self.arg_only or section not in self.arg_only[argument]:
# Determine the arg value and source
Expand Down Expand Up @@ -688,7 +688,8 @@ def add_subcommand(
self._subparsers.metavar = "{%s,%s}" % (self._subparsers.metavar[1:-1], name) if self._subparsers.metavar else "{%s%s}" % (self._subparsers.metavar[1:-1], name)
kwargs['help'] = description

self.subcommands[name] = SubparserWrapper(self, name, self._subparsers.add_parser(name, **kwargs))
# Type ignored because we explicitly add a subparser above
self.subcommands[name] = SubparserWrapper(self, name, self._subparsers.add_parser(name, **kwargs)) # type: ignore[union-attr]
self.subcommands[name].set_defaults(entrypoint=handler)

self.release_lock()
Expand Down

0 comments on commit 23633c6

Please sign in to comment.