Skip to content

Commit 35af1ef

Browse files
committed
Remove python_version mypy configuration; fix issues arising on 3.11-3.14
1 parent 2f624f4 commit 35af1ef

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
gil_enabled_at_start = True
1212
if FREE_THREADED_BUILD:
13-
gil_enabled_at_start = sys._is_gil_enabled() # type: ignore[attr-defined]
13+
gil_enabled_at_start = sys._is_gil_enabled() # type: ignore[attr-defined,unused-ignore]
1414

1515

1616
def pytest_report_header(config: pytest.Config) -> str:
@@ -28,7 +28,7 @@ def pytest_terminal_summary(terminalreporter: pytest.TerminalReporter) -> None:
2828
if (
2929
FREE_THREADED_BUILD
3030
and not gil_enabled_at_start
31-
and sys._is_gil_enabled() # type: ignore[attr-defined]
31+
and sys._is_gil_enabled() # type: ignore[attr-defined,unused-ignore]
3232
):
3333
tr = terminalreporter
3434
tr.ensure_newline()

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ lint.isort.required-imports = [
187187
max_supported_python = "3.15"
188188

189189
[tool.mypy]
190-
python_version = "3.11"
191190
disallow_subclassing_any = false
192191
disallow_untyped_calls = false
193192
warn_return_any = false

src/PIL/GifImagePlugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,9 @@ class Collector(BytesIO):
11951195
data = []
11961196

11971197
def write(self, data: Buffer) -> int:
1198-
self.data.append(data)
1199-
return len(data)
1198+
data_bytes = bytes(data)
1199+
self.data.append(data_bytes)
1200+
return len(data_bytes)
12001201

12011202
im.load() # make sure raster data is available
12021203

0 commit comments

Comments
 (0)