Skip to content

Commit d7bc90a

Browse files
committed
Type windows_flag to fix 'call-overload' mypy error
1 parent d99db91 commit d7bc90a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pylsp_mypy/plugin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import tempfile
1919
from configparser import ConfigParser
2020
from pathlib import Path
21-
from typing import IO, Any, Optional
21+
from typing import IO, Any, Optional, TypedDict
2222

2323
try:
2424
import tomllib
@@ -60,11 +60,16 @@
6060
# https://github.com/python-lsp/python-lsp-server/blob/v1.0.1/pylsp/plugins/pylint_lint.py#L55-L62
6161
last_diagnostics: dict[str, list[dict[str, Any]]] = collections.defaultdict(list)
6262

63+
6364
# Windows started opening opening a cmd-like window for every subprocess call
6465
# This flag prevents that.
6566
# This flag is new in python 3.7
6667
# This flag only exists on Windows
67-
windows_flag: dict[str, int] = (
68+
class WindowsFlag(TypedDict, total=False):
69+
creationflags: int
70+
71+
72+
windows_flag: WindowsFlag = (
6873
{"creationflags": subprocess.CREATE_NO_WINDOW} if os.name == "nt" else {} # type: ignore
6974
)
7075

0 commit comments

Comments
 (0)