Skip to content

Commit 7ddd912

Browse files
authored
Merge pull request #347 from befeleme/py314
Avoid the multiprocessing forkserver method
2 parents d637c12 + fed6e98 commit 7ddd912

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/unit/test_compat.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13+
import multiprocessing
1314
import os
1415
import shutil
1516
import signal
@@ -80,7 +81,15 @@ def test_non_file_like_obj(self):
8081
class TestBaseManager(unittest.TestCase):
8182
def create_pid_manager(self):
8283
class PIDManager(BaseManager):
83-
pass
84+
def __init__(self):
85+
# Python 3.14 changed the non-macOS POSIX default to forkserver
86+
# but the code in this module does not work with it
87+
# See https://github.com/python/cpython/issues/125714
88+
if multiprocessing.get_start_method() == 'forkserver':
89+
ctx = multiprocessing.get_context(method='fork')
90+
else:
91+
ctx = multiprocessing.get_context()
92+
super().__init__(ctx=ctx)
8493

8594
PIDManager.register('getpid', os.getpid)
8695
return PIDManager()

0 commit comments

Comments
 (0)