Skip to content

Commit

Permalink
Use cast() to work around pytype bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoluan committed Jan 13, 2023
1 parent 856fb1a commit b9f4887
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aiosmtpd/docs/_exts/autoprogramm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from docutils.statemachine import StringList
from functools import reduce
from sphinx.util.nodes import nested_parse_with_titles
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Dict, List, Optional, Tuple, cast


__all__ = ("AutoprogrammDirective", "import_object", "scan_programs", "setup")
Expand All @@ -54,7 +54,7 @@ def get_subparser_action(parser: argparse.ArgumentParser) -> argparse._SubParser

for a in parser._actions:
if isinstance(a, argparse._SubParsersAction):
return a
return cast(argparse._SubParsersAction, a)


def scan_programs(
Expand Down

0 comments on commit b9f4887

Please sign in to comment.