mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +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
1 changed files with 6 additions and 1 deletions
|
@ -41,6 +41,11 @@ Entry.__doc__ = '''The configuration `dict` for an entry.'''
|
|||
Entries = Dict[str, Entry]
|
||||
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):
|
||||
@dataclass(kw_only=True)
|
||||
class RichResult:
|
||||
|
@ -327,6 +332,6 @@ class GetVersionError(Exception):
|
|||
:param msg: The error message.
|
||||
: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.kwargs = kwargs
|
||||
|
|
Loading…
Add table
Reference in a new issue