mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #28371: Deprecate passing asyncio.Handles to run_in_executor.
This commit is contained in:
parent
3e56ff0d08
commit
0de3de6cbf
3 changed files with 11 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue