mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 07:17:17 +00:00
make mypy happy
This commit is contained in:
parent
1e85c1db70
commit
d1f990eac8
@ -22,6 +22,7 @@ import sys
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import TypeVar
|
||||||
|
|
||||||
from ahriman import version
|
from ahriman import version
|
||||||
from ahriman.application import handlers
|
from ahriman.application import handlers
|
||||||
@ -32,8 +33,11 @@ from ahriman.models.sign_settings import SignSettings
|
|||||||
from ahriman.models.user_access import UserAccess
|
from ahriman.models.user_access import UserAccess
|
||||||
|
|
||||||
|
|
||||||
# pylint thinks it is bad idea, but get the fuck off
|
# this workaround is for several things
|
||||||
SubParserAction = argparse._SubParsersAction # pylint: disable=protected-access
|
# firstly python devs don't think that is it error and asking you for workarounds https://bugs.python.org/issue41592
|
||||||
|
# secondly linters don't like when you are importing private members
|
||||||
|
# thirdly new mypy doesn't like _SubParsersAction and thinks it is a template
|
||||||
|
SubParserAction = TypeVar("SubParserAction", bound="argparse._SubParsersAction[argparse.ArgumentParser]")
|
||||||
|
|
||||||
|
|
||||||
def _formatter(prog: str) -> argparse.HelpFormatter:
|
def _formatter(prog: str) -> argparse.HelpFormatter:
|
||||||
|
Loading…
Reference in New Issue
Block a user