[Python-checkins] [python/cpython] 5e94de: bpo-30048: asyncio: fix Task.cancel() was ignored....

GitHub noreply at github.com
Fri May 12 01:34:41 EDT 2017


  Branch: refs/heads/3.5
  Home:   https://github.com/python/cpython
  Commit: 5e94dedcddf5e09164bf20f18a3c701eeb96c71e
      https://github.com/python/cpython/commit/5e94dedcddf5e09164bf20f18a3c701eeb96c71e
  Author: INADA Naoki <methane at users.noreply.github.com>
  Date:   2017-05-12 (Fri, 12 May 2017)

  Changed paths:
    M Lib/asyncio/tasks.py
    M Lib/test/test_asyncio/test_tasks.py
    M Misc/NEWS

  Log Message:
  -----------
  bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1547)

* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097)

when there are no more `await` or `yield (from)` before return in coroutine,
cancel was ignored.

example:

    async def coro():
  asyncio.Task.current_task().cancel()
  return 42
    ...
    res = await coro()  # should raise CancelledError
(cherry picked from commit 991adca012f5e106c2d4040ce619c696ba6f9c46)

* fix test




More information about the Python-checkins mailing list