File: python3.14.patch

package info (click to toggle)
mapproxy 6.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 11,284 kB
  • sloc: python: 50,136; xml: 6,412; javascript: 1,606; sh: 90; makefile: 56
file content (31 lines) | stat: -rw-r--r-- 870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Explicitly use 'fork' instead of 'forkserver'.
 Fixes FTBFS with python3.14.
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/mapproxy/mapproxy/pull/1355

--- a/mapproxy/test/conftest.py
+++ b/mapproxy/test/conftest.py
@@ -1,3 +1,8 @@
+import multiprocessing
+
+import pytest
+
+
 def pytest_configure(config):
     import sys
     sys._called_from_pytest = True
@@ -6,3 +11,14 @@ def pytest_configure(config):
 def pytest_unconfigure(config):
     import sys
     del sys._called_from_pytest
+
+
+@pytest.fixture(scope="session", autouse=True)
+def use_multiprocessing_fork_on_linux():
+    import sys
+    if sys.platform != "linux":
+        # Windows and macOS use 'spawn' by default
+        return
+
+    # 'forkserver' is default since Python 3.14, but can't pickle everything.
+    multiprocessing.set_start_method("fork")