diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-05 15:27:34 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-05 15:27:34 +0200 |
commit | c6b7d7c1bdaadd9297a4e47ddf5aa49388e38ad0 (patch) | |
tree | 3d01af7fd874b8aaec4799f45a9046e274df41b7 /asyncio/queues.py | |
parent | 07b14e3a7f103709232c304c0563b18d91a852ec (diff) | |
download | trollius-c6b7d7c1bdaadd9297a4e47ddf5aa49388e38ad0.tar.gz |
Python issue 21447, 21886: Fix a race condition when setting the result of a
Future with call_soon(). Add an helper, an private method, to set the result
only if the future was not cancelled.
Diffstat (limited to 'asyncio/queues.py')
-rw-r--r-- | asyncio/queues.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/asyncio/queues.py b/asyncio/queues.py index 57afb05..41551a9 100644 --- a/asyncio/queues.py +++ b/asyncio/queues.py @@ -173,7 +173,7 @@ class Queue: # run, we need to defer the put for a tick to ensure that # getters and putters alternate perfectly. See # ChannelTest.test_wait. - self._loop.call_soon(putter.set_result, None) + self._loop.call_soon(putter._set_result_unless_cancelled, None) return self._get() |