From 782d3c2d3b7c6fc06e8057be64828eb0be2df15b Mon Sep 17 00:00:00 2001 From: richardsheridan Date: Sun, 17 Nov 2024 12:00:52 -0500 Subject: [PATCH] bugfix trio util removal (#444) --- _trio_parallel_workers/_funcs.py | 6 ------ trio_parallel/_tests/test_proc.py | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/_trio_parallel_workers/_funcs.py b/_trio_parallel_workers/_funcs.py index 201fae8a..30456976 100644 --- a/_trio_parallel_workers/_funcs.py +++ b/_trio_parallel_workers/_funcs.py @@ -58,12 +58,6 @@ def _never_halts(ev): # pragma: no cover, worker will be killed pass -def _raise_ki(): - import signal, trio - - trio._util.signal_raise(signal.SIGINT) - - _lambda = lambda: None # pragma: no cover, never run diff --git a/trio_parallel/_tests/test_proc.py b/trio_parallel/_tests/test_proc.py index ae03a4b6..50a5eda4 100644 --- a/trio_parallel/_tests/test_proc.py +++ b/trio_parallel/_tests/test_proc.py @@ -6,6 +6,7 @@ import math import os +import signal import trio import pytest @@ -13,7 +14,6 @@ from _trio_parallel_workers._funcs import ( _lambda, _return_lambda, - _raise_ki, _never_halts, _no_trio, ) @@ -97,7 +97,7 @@ async def test_exhaustively_cancel_run_sync(worker, manager): async def test_ki_does_not_propagate(worker): - (await worker.run_sync(_raise_ki)).unwrap() + (await worker.run_sync(signal.raise_signal, signal.SIGINT)).unwrap() @pytest.mark.parametrize("job", [_lambda, _return_lambda])