mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() (GH-8533)
Various asyncio internals expect that the default executor is a `ThreadPoolExecutor`, so deprecate passing anything else to `loop.set_default_executor()`.
This commit is contained in:
parent
4e11c461ed
commit
22d25085db
5 changed files with 35 additions and 2 deletions
|
@ -906,7 +906,14 @@ pool of processes). By default, an event loop uses a thread pool executor
|
|||
|
||||
.. method:: AbstractEventLoop.set_default_executor(executor)
|
||||
|
||||
Set the default executor used by :meth:`run_in_executor`.
|
||||
Set *executor* as the default executor used by :meth:`run_in_executor`.
|
||||
*executor* should be an instance of
|
||||
:class:`~concurrent.futures.ThreadPoolExecutor`.
|
||||
|
||||
.. deprecated:: 3.8
|
||||
Using an executor that is not an instance of
|
||||
:class:`~concurrent.futures.ThreadPoolExecutor` is deprecated and
|
||||
will trigger an error in Python 3.9.
|
||||
|
||||
|
||||
Error Handling API
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue