Skip to content

Commit b2daa72

Browse files
committed
MyPy Fixes
1 parent 88c7a9f commit b2daa72

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/relic/core/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44
from argparse import ArgumentParser, Namespace
5-
from typing import Optional, TYPE_CHECKING, Protocol, Any
5+
from typing import Optional, TYPE_CHECKING, Protocol, Any, Union
66

77
import pkg_resources
88

@@ -18,7 +18,7 @@ def add_parser( # pylint: disable=redefined-builtin, unused-argument # typechec
1818
help: Optional[str] = None,
1919
**kwargs: Any,
2020
) -> ArgumentParser:
21-
...
21+
raise NotImplementedError
2222

2323

2424
class CliEntrypoint(Protocol): # pylint: disable= too-few-public-methods
@@ -36,12 +36,12 @@ def _run(self, ns: Namespace) -> int:
3636
"Command defined in argparse, but it's function was not specified."
3737
)
3838
cmd = ns.cmd
39-
result = cmd(ns)
39+
result: Optional[int] = cmd(ns)
4040
if result is None: # Assume success
4141
result = 0
4242
return result
4343

44-
def run_with(self, *args: Any) -> Optional[int]:
44+
def run_with(self, *args: Any) -> Union[str, int, None]:
4545
try:
4646
ns = self.parser.parse_args(args)
4747
return self._run(ns)

0 commit comments

Comments
 (0)