]> granicus.if.org Git - python/commit
Issue #21326: Add asyncio.BaseEventLoop.is_closed() method
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 3 Jun 2014 23:06:24 +0000 (01:06 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 3 Jun 2014 23:06:24 +0000 (01:06 +0200)
commit17f3663497116316116fa560ce59f842cee4e473
tree6b9079da8f666037b1c4efc178e97efc197cf3b7
parent8526a945a09656338dcccec23ac69269462a34e0
Issue #21326: Add asyncio.BaseEventLoop.is_closed() method

Add BaseEventLoop._closed attribute and use it to check if the event loop was
closed or not, instead of checking different attributes in each subclass of
BaseEventLoop.

run_forever() and run_until_complete() now raises a RuntimeError('Event loop is
closed') exception if the event loop was closed.

BaseProactorEventLoop.close() now also cancels "accept futures".
Doc/library/asyncio-eventloop.rst
Lib/asyncio/base_events.py
Lib/asyncio/proactor_events.py
Lib/asyncio/selector_events.py
Lib/test/test_asyncio/test_base_events.py
Lib/test/test_asyncio/test_selector_events.py