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/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}") 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", ] 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()