]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 17 Aug 2020 14:37:12 +0000 (07:37 -0700)
committerGitHub <noreply@github.com>
Mon, 17 Aug 2020 14:37:12 +0000 (07:37 -0700)
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 29f84294d88ec493c2de9d6e8dbc12fae3778771)

Co-authored-by: James Weaver <james.barrett@bbc.co.uk>
Lib/asyncio/events.py
Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst [new file with mode: 0644]

index ca08663a5b3586382ac620c07e6248f91583b2e3..353a9f5af0c49b30d9476dec3041a362c61cfcf4 100644 (file)
@@ -280,7 +280,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 (file)
index 0000000..d4c7e0e
--- /dev/null
@@ -0,0 +1 @@
+Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine.
\ No newline at end of file