From: Colin Watson <cjwatson@debian.org>
Date: Tue, 6 Jan 2026 12:38:19 +0000
Subject: Fix multicore tests on Python 3.14

The pool initializer function must be pickleable.

Forwarded: https://github.com/cokelaer/easydev/pull/40
Bug-Debian: https://bugs.debian.org/1123235
Last-Update: 2026-01-06
---
 easydev/multicore.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/easydev/multicore.py b/easydev/multicore.py
index c977525..c64c0b9 100644
--- a/easydev/multicore.py
+++ b/easydev/multicore.py
@@ -19,6 +19,12 @@ from multiprocessing import Pool, Process, Queue, cpu_count
 __all__ = ["MultiProcessing"]
 
 
+def _init_worker():
+    import signal
+
+    signal.signal(signal.SIGINT, signal.SIG_IGN)
+
+
 class MultiProcessing(object):
     """Class to run jobs in an asynchronous manner.
 
@@ -102,13 +108,8 @@ class MultiProcessing(object):
             self.pb = Progress(len(self.jobs), 1)
             self.pb.animate(0)
 
-        def init_worker():
-            import signal
-
-            signal.signal(signal.SIGINT, signal.SIG_IGN)
-
         self.results = []
-        self.pool = Pool(self.maxcpu, init_worker)
+        self.pool = Pool(self.maxcpu, _init_worker)
 
         for process in self.jobs:
             self.pool.apply_async(process._target, process._args, process._kwargs, callback=self._cb)
