mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540)
This commit is contained in:
parent
a1092f6249
commit
ddd5f36971
5 changed files with 21 additions and 17 deletions
|
|
@ -814,11 +814,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
|
||||
def set_default_executor(self, executor):
|
||||
if not isinstance(executor, concurrent.futures.ThreadPoolExecutor):
|
||||
warnings.warn(
|
||||
'Using the default executor that is not an instance of '
|
||||
'ThreadPoolExecutor is deprecated and will be prohibited '
|
||||
'in Python 3.9',
|
||||
DeprecationWarning, 2)
|
||||
raise TypeError('executor must be ThreadPoolExecutor instance')
|
||||
self._default_executor = executor
|
||||
|
||||
def _getaddrinfo_debug(self, host, port, family, type, proto, flags):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue