mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-02-13 17:07:14 +00:00
use LiteralString (although mypy hasn't supported it yet)
https://github.com/python/mypy/issues/12554
This commit is contained in:
parent
c53952c75c
commit
a7e6512e70
@ -41,6 +41,11 @@ Entry.__doc__ = '''The configuration `dict` for an entry.'''
|
|||||||
Entries = Dict[str, Entry]
|
Entries = Dict[str, Entry]
|
||||||
VersData = Dict[str, str]
|
VersData = Dict[str, str]
|
||||||
|
|
||||||
|
if sys.version_info[:2] >= (3, 11):
|
||||||
|
from typing import LiteralString
|
||||||
|
else:
|
||||||
|
LiteralString = str
|
||||||
|
|
||||||
if sys.version_info[:2] >= (3, 10):
|
if sys.version_info[:2] >= (3, 10):
|
||||||
@dataclass(kw_only=True)
|
@dataclass(kw_only=True)
|
||||||
class RichResult:
|
class RichResult:
|
||||||
@ -327,6 +332,6 @@ class GetVersionError(Exception):
|
|||||||
:param msg: The error message.
|
:param msg: The error message.
|
||||||
:param kwargs: Arbitrary additional context for the error.
|
:param kwargs: Arbitrary additional context for the error.
|
||||||
'''
|
'''
|
||||||
def __init__(self, msg: str, **kwargs: Any) -> None:
|
def __init__(self, msg: LiteralString, **kwargs: Any) -> None:
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
self.kwargs = kwargs
|
self.kwargs = kwargs
|
||||||
|
Loading…
Reference in New Issue
Block a user