Skip to content

Commit

Permalink
Disable bad-return-type temporarily
Browse files Browse the repository at this point in the history
After careful consideration, it seems that pytype was actually complaining
of the possible "implicit return None" if a suitable value is not found
in the `for a` loop.

Lacking a better solution, I decided to temporarily disable this kind of
error just for this function.
  • Loading branch information
pepoluan committed Jan 13, 2023
1 parent b9f4887 commit 6bdf899
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aiosmtpd/docs/_exts/autoprogramm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@
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, cast
from typing import Any, Dict, List, Optional, Tuple


__all__ = ("AutoprogrammDirective", "import_object", "scan_programs", "setup")


# pytype: disable=bad-return-type
def get_subparser_action(parser: argparse.ArgumentParser) -> argparse._SubParsersAction:
neg1_action = parser._actions[-1]

Expand All @@ -54,7 +55,8 @@ def get_subparser_action(parser: argparse.ArgumentParser) -> argparse._SubParser

for a in parser._actions:
if isinstance(a, argparse._SubParsersAction):
return cast(argparse._SubParsersAction, a)
return a
# pytype: enable=bad-return-type


def scan_programs(
Expand Down

0 comments on commit 6bdf899

Please sign in to comment.