From c9bf998520ff37db3e5271e16db8ba3d14558595 Mon Sep 17 00:00:00 2001 From: Caleb Hattingh Date: Mon, 30 Mar 2026 00:53:27 +0200 Subject: [PATCH 1/3] Add Python 3.14 to CI and project classifiers Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/pythonapp.yml | 2 +- noxfile.py | 2 ++ pyproject.toml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 0d74685..073f90c 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] os: [ubuntu-latest] fail-fast: false timeout-minutes: 5 diff --git a/noxfile.py b/noxfile.py index fa3205d..2a36213 100644 --- a/noxfile.py +++ b/noxfile.py @@ -10,6 +10,7 @@ "3.11", "3.12", "3.13", + "3.14", ] ) def test(session): @@ -25,6 +26,7 @@ def test(session): "3.11", "3.12", "3.13", + "3.14", ] ) def testcov(session): diff --git a/pyproject.toml b/pyproject.toml index e4695ab..da1d0a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation", "Programming Language :: Python :: Implementation :: CPython", ] From 63f911271ecc699b49bd077851566e479b4e094a Mon Sep 17 00:00:00 2001 From: Caleb Hattingh Date: Mon, 30 Mar 2026 15:46:08 +0200 Subject: [PATCH 2/3] Fix pickle tests for Python 3.14 Python 3.14 raises pickle.PicklingError instead of AttributeError when trying to pickle local/lambda functions. Accept both exception types so the tests pass on 3.9-3.14. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/test_deadpool.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_deadpool.py b/tests/test_deadpool.py index 9040647..b80684e 100644 --- a/tests/test_deadpool.py +++ b/tests/test_deadpool.py @@ -1,6 +1,7 @@ import asyncio import logging import os +import pickle import queue import signal import sys @@ -690,7 +691,9 @@ def f(): with deadpool.Deadpool() as exe: fut = exe.submit(f) - with pytest.raises(AttributeError, match="local object"): + with pytest.raises( + (AttributeError, pickle.PicklingError), match="local object" + ): fut.result() @@ -704,7 +707,9 @@ def f(): with ProcessPoolExecutor() as exe: fut = exe.submit(f) - with pytest.raises(AttributeError, match="local object"): + with pytest.raises( + (AttributeError, pickle.PicklingError), match="local object" + ): fut.result() @@ -714,7 +719,9 @@ def test_can_pickle_lambda_function(): with deadpool.Deadpool() as exe: fut = exe.submit(lambda: 123) - with pytest.raises(AttributeError, match="local object"): + with pytest.raises( + (AttributeError, pickle.PicklingError), match="local object" + ): fut.result() From 7f21a7ec951a20f094abacb7630baa4522bbe92a Mon Sep 17 00:00:00 2001 From: Caleb Hattingh Date: Mon, 30 Mar 2026 15:51:03 +0200 Subject: [PATCH 3/3] Fix SyntaxWarning for break in finally block on Python 3.14 Move the break out of the finally clause and place it after the try/except/else block. The behavior is identical: the loop exits after processing results regardless of which branch executed. Co-Authored-By: Claude Opus 4.6 (1M context) --- deadpool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deadpool.py b/deadpool.py index b154f40..a973b9e 100644 --- a/deadpool.py +++ b/deadpool.py @@ -572,8 +572,7 @@ def run_task(self, fn, args, kwargs, timeout, fut: Future): f"TimeoutError on {worker.pid}, setting ok=False" ) worker.ok = False - finally: - break + break elif not worker.is_alive(): self._statistics.tasks_failed.increment() logger.debug(f"p is no longer alive: {worker.process}")