Skip to content

Commit a31fb82

Browse files
committed
CLN trailing compat for <3.8
1 parent d8bb877 commit a31fb82

File tree

5 files changed

+4
-18
lines changed

5 files changed

+4
-18
lines changed

loky/backend/popen_loky_posix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _launch(self, process_obj):
119119
reduction._mk_inheritable(child_w)
120120
reduction._mk_inheritable(tracker_fd)
121121
self._fds += [child_r, child_w, tracker_fd]
122-
if sys.version_info >= (3, 8) and os.name == "posix":
122+
if os.name == "posix":
123123
mp_tracker_fd = prep_data["mp_tracker_args"]["fd"]
124124
self.duplicate_for_child(mp_tracker_fd)
125125

loky/backend/spawn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_preparation_data(name, init_main_module=True):
8888
else:
8989
d["tracker_args"]["fd"] = _resource_tracker._fd
9090

91-
if sys.version_info >= (3, 8) and os.name == "posix":
91+
if os.name == "posix":
9292
# joblib/loky#242: allow loky processes to retrieve the resource
9393
# tracker of their parent in case the child processes depickles
9494
# shared_memory objects, that are still tracked by multiprocessing's

tests/_test_process_executor.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,8 @@ def test_shutdown_race_issue12456(self):
683683
self.executor.shutdown()
684684

685685
@pytest.mark.skipif(
686-
platform.python_implementation() != "CPython"
687-
or (sys.version_info >= (3, 8, 0) and sys.version_info < (3, 8, 2)),
688-
reason="Underlying bug fixed upstream starting Python 3.8.2",
686+
platform.python_implementation() != "CPython",
687+
reason="cpython specific non-regression test (fixed starting 3.8.2)",
689688
)
690689
def test_no_stale_references(self):
691690
# Issue #16284: check that the executors don't unnecessarily hang onto
@@ -978,10 +977,6 @@ def test_max_depth(self, kill_workers):
978977
sys.maxsize < 2**32,
979978
reason="Test requires a 64 bit version of Python",
980979
)
981-
@pytest.mark.skipif(
982-
sys.version_info < (3, 8),
983-
reason="Python version does not support pickling objects of size > 2 ** 31GB",
984-
)
985980
def test_no_failure_on_large_data_send(self):
986981
data = b"\x00" * int(2.2e9)
987982
self.executor.submit(id, data).result()
@@ -991,10 +986,6 @@ def test_no_failure_on_large_data_send(self):
991986
sys.maxsize < 2**32,
992987
reason="Test requires a 64 bit version of Python",
993988
)
994-
@pytest.mark.skipif(
995-
sys.version_info >= (3, 8),
996-
reason="Python version supports pickling objects of size > 2 ** 31GB",
997-
)
998989
def test_expected_failure_on_large_data_send(self):
999990
data = b"\x00" * int(2.2e9)
1000991
with pytest.raises(RuntimeError):

tests/test_resource_tracker.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,6 @@ def test_resource_tracker_sigkill(self):
286286
# Uncatchable signal.
287287
self.check_resource_tracker_death(signal.SIGKILL, True)
288288

289-
@pytest.mark.skipif(
290-
sys.version_info < (3, 8),
291-
reason="SharedMemory introduced in Python 3.8",
292-
)
293289
def test_loky_process_inherit_multiprocessing_resource_tracker(self):
294290
cmd = """if 1:
295291
from loky import get_reusable_executor

tests/test_reusable_executor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ def test_crash_races(self, n_proc):
377377

378378
if (
379379
sys.platform == "win32"
380-
and sys.version_info >= (3, 8)
381380
and n_proc > 5
382381
):
383382
pytest.skip(

0 commit comments

Comments
 (0)