Skip to content

Commit a474e29

Browse files
committed
homogenize the check
1 parent 1a81fea commit a474e29

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

adaptive/runner.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import itertools
99
import pickle
1010
import platform
11+
import sys
1112
import time
1213
import traceback
1314
import warnings
@@ -44,12 +45,9 @@
4445

4546

4647
# -- Runner definitions
47-
# Check if InterpreterPoolExecutor is available (Python 3.14+)
48-
_has_interpreter_pool = hasattr(concurrent, "InterpreterPoolExecutor")
48+
_has_interpreter_pool = sys.version_info >= (3, 14)
4949

5050
if _has_interpreter_pool:
51-
# Use InterpreterPoolExecutor for Python 3.14+
52-
# It provides better isolation and performance than ProcessPoolExecutor
5351
_default_executor = concurrent.InterpreterPoolExecutor # type: ignore[misc,attr-defined]
5452
elif platform.system() == "Linux":
5553
_default_executor = concurrent.ProcessPoolExecutor # type: ignore[misc]

0 commit comments

Comments
 (0)