diff options
author | Illia Volochii <illia.volochii@gmail.com> | 2021-07-01 14:46:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 14:46:49 (GMT) |
commit | ddd5f36971e2ffe20cc3f4b408425c847d168646 (patch) | |
tree | 19ac45289e1129ba41896aee92c54ecf27927216 /Lib/asyncio/base_events.py | |
parent | a1092f62492a3fcd6195bea94eccf8d5a300acb1 (diff) | |
download | cpython-ddd5f36971e2ffe20cc3f4b408425c847d168646.zip cpython-ddd5f36971e2ffe20cc3f4b408425c847d168646.tar.gz cpython-ddd5f36971e2ffe20cc3f4b408425c847d168646.tar.bz2 |
bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540)
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index f789635..74d5670 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -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): |