summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index dc0ca3f02b..75989a7641 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -741,6 +741,12 @@ class BaseEventLoop(events.AbstractEventLoop):
executor.submit(func, *args), loop=self)
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)
self._default_executor = executor
def _getaddrinfo_debug(self, host, port, family, type, proto, flags):