Skip to content

Commit d6bdf6d

Browse files
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852)
asyncio.AbstractEventLoop.run_in_executor should be a method that returns an asyncio Future, not an async method. This matches the concrete implementations, and the documentation better. (cherry picked from commit 29f8429) Co-authored-by: James Weaver <james.barrett@bbc.co.uk>
1 parent 2c050e5 commit d6bdf6d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/asyncio/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def create_task(self, coro, *, name=None):
283283
def call_soon_threadsafe(self, callback, *args):
284284
raise NotImplementedError
285285

286-
async def run_in_executor(self, executor, func, *args):
286+
def run_in_executor(self, executor, func, *args):
287287
raise NotImplementedError
288288

289289
def set_default_executor(self, executor):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine.

0 commit comments

Comments
 (0)