Issue #28371: Deprecate passing asyncio.Handles to run_in_executor.

This commit is contained in:
Yury Selivanov 2016-10-05 18:28:09 -04:00
parent 3e56ff0d08
commit 0de3de6cbf
3 changed files with 11 additions and 3 deletions

View file

@ -605,6 +605,9 @@ class BaseEventLoop(events.AbstractEventLoop):
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)