From: James Weaver Date: Mon, 17 Aug 2020 14:19:46 +0000 (+0100) Subject: bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a... X-Git-Tag: v3.10.0a1~239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29f84294d88ec493c2de9d6e8dbc12fae3778771;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 70017cb86a05..0dce87b8ecc5 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -283,7 +283,7 @@ class AbstractEventLoop: def call_soon_threadsafe(self, callback, *args): raise NotImplementedError - async def run_in_executor(self, executor, func, *args): + def run_in_executor(self, executor, func, *args): raise NotImplementedError def set_default_executor(self, executor): diff --git a/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst new file mode 100644 index 000000000000..d4c7e0e2419d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst @@ -0,0 +1 @@ +Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine. \ No newline at end of file