We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f742b20 commit a6f559fCopy full SHA for a6f559f
1 file changed
conditional_futures/threadpool.py
@@ -13,6 +13,7 @@ def is_no_gil() -> bool:
13
14
15
IS_NO_GIL = is_no_gil()
16
+IS_PY_GTE314 = sys.version_info >= (3, 14)
17
18
19
class SingleThreadExecutor(Executor):
@@ -94,13 +95,14 @@ def map(
94
95
chunksize: int = 1,
96
buffersize: int | None = None,
97
) -> Iterator[TVReturn]:
- return self._executor.map(
98
- fn,
99
- *iterables,
100
- timeout=timeout,
101
- chunksize=chunksize,
102
- buffersize=buffersize,
103
- )
+ # buffersize is only supported in Python 3.14+
+ kwargs: dict[str, Any] = {
+ 'timeout': timeout,
+ 'chunksize': chunksize,
+ }
+ if IS_PY_GTE314 and buffersize is not None:
104
+ kwargs['buffersize'] = buffersize
105
+ return self._executor.map(fn, *iterables, **kwargs)
106
107
def shutdown(
108
self,
0 commit comments