From 0adbac1d9dab333d50d05469125dd44d15e6029e Mon Sep 17 00:00:00 2001 From: Mandeep Singh Date: Sun, 16 Jul 2017 13:14:13 +0530 Subject: [PATCH 1/2] bpo-30935: update get_event_loop docs add version changed directive --- Doc/library/asyncio-eventloop.rst | 2 +- Doc/whatsnew/3.6.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 83bbb70b037928..a8327c897a3c0a 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -49,7 +49,7 @@ Run an event loop that callbacks scheduled by callbacks will not run in that case; they will run the next time :meth:`run_forever` is called. - .. versionchanged:: 3.5.1 + .. versionchanged:: 3.6 .. method:: AbstractEventLoop.run_until_complete(future) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 60469cd1d36519..fdce8bb4d7d99b 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -819,7 +819,7 @@ Notable changes in the :mod:`asyncio` module since Python 3.5.0 (all backported to 3.5.x due to the provisional status): * The :func:`~asyncio.get_event_loop` function has been changed to - always return the currently running loop when called from couroutines + always return the currently running loop when called from coroutines and callbacks. (Contributed by Yury Selivanov in :issue:`28613`.) From 7d5d8fb07fe9bc170909887887be2c26d88650a8 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Date: Mon, 2 Oct 2017 13:23:55 +0530 Subject: [PATCH 2/2] add requested docs --- Doc/library/asyncio-eventloop.rst | 2 +- Doc/library/asyncio-eventloops.rst | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index a8327c897a3c0a..83bbb70b037928 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -49,7 +49,7 @@ Run an event loop that callbacks scheduled by callbacks will not run in that case; they will run the next time :meth:`run_forever` is called. - .. versionchanged:: 3.6 + .. versionchanged:: 3.5.1 .. method:: AbstractEventLoop.run_until_complete(future) diff --git a/Doc/library/asyncio-eventloops.rst b/Doc/library/asyncio-eventloops.rst index d74fcb1e07f249..dd8b2f382ac268 100644 --- a/Doc/library/asyncio-eventloops.rst +++ b/Doc/library/asyncio-eventloops.rst @@ -170,12 +170,15 @@ An event loop policy must implement the following interface: Get the event loop for the current context. Returns an event loop object implementing the :class:`AbstractEventLoop` - interface. + interface. In case called from coroutine, it returns the currently + running event loop. Raises an exception in case no event loop has been set for the current context and the current policy does not specify to create one. It must never return ``None``. + .. versionchanged:: 3.6 + .. method:: set_event_loop(loop) Set the event loop for the current context to *loop*.