Skip to content

Commit a7e6512

Browse files
committed
use LiteralString (although mypy hasn't supported it yet)
python/mypy#12554
1 parent c53952c commit a7e6512

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nvchecker/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
Entries = Dict[str, Entry]
4242
VersData = Dict[str, str]
4343

44+
if sys.version_info[:2] >= (3, 11):
45+
from typing import LiteralString
46+
else:
47+
LiteralString = str
48+
4449
if sys.version_info[:2] >= (3, 10):
4550
@dataclass(kw_only=True)
4651
class RichResult:
@@ -327,6 +332,6 @@ class GetVersionError(Exception):
327332
:param msg: The error message.
328333
:param kwargs: Arbitrary additional context for the error.
329334
'''
330-
def __init__(self, msg: str, **kwargs: Any) -> None:
335+
def __init__(self, msg: LiteralString, **kwargs: Any) -> None:
331336
self.msg = msg
332337
self.kwargs = kwargs

0 commit comments

Comments
 (0)