Issue #28371: Deprecate passing asyncio.Handles to run_in_executor.
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index af66c0a..648b9b9 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -605,6 +605,9 @@
if isinstance(func, events.Handle):
assert not args
assert not isinstance(func, events.TimerHandle)
+ warnings.warn(
+ "Passing Handle to loop.run_in_executor() is deprecated",
+ DeprecationWarning)
if func._cancelled:
f = self.create_future()
f.set_result(None)