Message352131
Thanks for the report. This looks like a valid change to me as I can see from the docstring it says it can be None but in the source code there is an explicit check that if self._local._loop which is returned is None then raise a RuntimeError. I would propose removing the docstring in the example.
# Docstring says can be None
./python.exe -m pydoc asyncio.events.BaseDefaultEventLoopPolicy.get_event_loop | cat
Help on function get_event_loop in asyncio.events.BaseDefaultEventLoopPolicy:
asyncio.events.BaseDefaultEventLoopPolicy.get_event_loop = get_event_loop(self)
Get the event loop.
This may be None or an instance of EventLoop.
# RuntimeError is raised for None
./python.exe -m inspect asyncio.events:BaseDefaultEventLoopPolicy.get_event_loop
def get_event_loop(self):
"""Get the event loop.
This may be None or an instance of EventLoop.
"""
if (self._local._loop is None and
not self._local._set_called and
isinstance(threading.current_thread(), threading._MainThread)):
self.set_event_loop(self.new_event_loop())
if self._local._loop is None:
raise RuntimeError('There is no current event loop in thread %r.'
% threading.current_thread().name)
return self._local._loop |
|
Date |
User |
Action |
Args |
2019-09-12 11:39:32 | xtreak | set | recipients:
+ xtreak, asvetlov, docs@python, yselivanov, drtyrsa |
2019-09-12 11:39:32 | xtreak | set | messageid: <1568288372.14.0.15084571934.issue34344@roundup.psfhosted.org> |
2019-09-12 11:39:32 | xtreak | link | issue34344 messages |
2019-09-12 11:39:32 | xtreak | create | |
|