Skip to content

Commit 377a3ef

Browse files
committed
Update mypy to 1.11
1 parent a9010f3 commit 377a3ef

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
fail-fast: false
131131
matrix:
132132
# mypy 1.5 dropped support for Python 3.7
133+
# mypy won't understand "3.13-dev", keeping the CI simple by just omitting it
133134
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
134135
steps:
135136
- uses: actions/checkout@v4
@@ -139,7 +140,7 @@ jobs:
139140
cache: pip
140141
cache-dependency-path: .github/workflows/main.yml
141142
check-latest: true
142-
- run: pip install types-regex types-setuptools mypy==1.9
143+
- run: pip install types-regex types-setuptools mypy==1.11
143144
- run: mypy . --python-version=${{ matrix.python-version }}
144145

145146
pyright:

Pythonwin/pywin/framework/stdin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,4 @@ def fake_input(prompt=None):
168168
finally:
169169
get_input_line = input
170170
else:
171-
sys.stdin = Stdin() # type: ignore[assignment] # Not an actual TextIO
171+
sys.stdin = Stdin()

com/win32com/makegw/makegwparse.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
interface
1313
"""
1414

15+
from __future__ import annotations
16+
1517
import re
1618
import traceback
1719

@@ -701,7 +703,9 @@ def _GetPythonTypeDesc(self):
701703
return ConvertSimpleTypes[self.arg.type][1]
702704

703705

704-
AllConverters = {
706+
AllConverters: dict[
707+
str, tuple[type[ArgFormatter], int, int] | tuple[type[ArgFormatter], int]
708+
] = {
705709
"const OLECHAR": (ArgFormatterOLECHAR, 0, 1),
706710
"WCHAR": (ArgFormatterOLECHAR, 0, 1),
707711
"OLECHAR": (ArgFormatterOLECHAR, 0, 1),

com/win32comext/axscript/client/error.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ def _BuildFromOther(self, site: COMScript, value: BaseException | None):
181181
tb_top = tb
182182

183183
bits = ["Traceback (most recent call last):\n"]
184-
# Fixed in https://github.com/python/typeshed/pull/11675 , to be included in next mypy release
185-
bits.extend(traceback.format_list(format_items)) # type: ignore[arg-type]
184+
bits.extend(traceback.format_list(format_items))
186185
if isinstance(value, pythoncom.com_error):
187186
desc = f"{value.strerror} (0x{value.hresult:x})"
188187
if (

pywin32_postinstall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def flush(self):
4242
if sys.stdout is None: # pyright: ignore[reportUnnecessaryComparison]
4343
sys.stdout = sys.stderr
4444

45-
sys.stderr = Tee(sys.stderr) # type: ignore[assignment] # Not an actual TextIO
46-
sys.stdout = Tee(sys.stdout) # type: ignore[assignment] # Not an actual TextIO
45+
sys.stderr = Tee(sys.stderr)
46+
sys.stdout = Tee(sys.stdout)
4747

4848
com_modules = [
4949
# module_name, class_names

0 commit comments

Comments
 (0)