]> granicus.if.org Git - python/commit
bpo-33238: Add InvalidStateError to concurrent.futures. (GH-7056)
authorjhaydaman <33549221+jhaydaman@users.noreply.github.com>
Wed, 30 May 2018 07:15:06 +0000 (02:15 -0500)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Wed, 30 May 2018 07:15:06 +0000 (10:15 +0300)
commit0a28c0d12ee7201de039ced4d815f57f1f8fd48c
tree9fa72f88b1f3035ea9fe5a4bde10215a432abe30
parentbb9474f1fb2fc7c7ed9f826b78262d6a12b5f9e8
bpo-33238: Add InvalidStateError to concurrent.futures. (GH-7056)

Future.set_result and Future.set_exception now raise InvalidStateError
if the futures are not pending or running. This mirrors the behavior
of asyncio.Future, and prevents AssertionErrors in asyncio.wrap_future
when set_result is called multiple times.
Doc/library/concurrent.futures.rst
Lib/asyncio/base_futures.py
Lib/concurrent/futures/__init__.py
Lib/concurrent/futures/_base.py
Lib/test/test_concurrent_futures.py
Misc/NEWS.d/next/Library/2018-05-24-09-15-52.bpo-33238.ooDfoo.rst [new file with mode: 0644]