mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
bpo-46829: Deprecate passing a message into Future.cancel() and Task.cancel() (GH-31840)
After a long deliberation we ended up feeling that the message argument for Future.cancel(), added in 3.9, was a bad idea, so we're deprecating it in 3.11 and plan to remove it in 3.13.
This commit is contained in:
parent
624e3986fb
commit
0360e9f346
9 changed files with 106 additions and 17 deletions
|
@ -191,12 +191,10 @@ class TestTaskGroup(unittest.IsolatedAsyncioTestCase):
|
|||
await asyncio.sleep(0.1)
|
||||
|
||||
self.assertFalse(r.done())
|
||||
r.cancel("test")
|
||||
r.cancel()
|
||||
with self.assertRaises(asyncio.CancelledError) as cm:
|
||||
await r
|
||||
|
||||
self.assertEqual(cm.exception.args, ('test',))
|
||||
|
||||
self.assertEqual(NUM, 5)
|
||||
|
||||
async def test_taskgroup_07(self):
|
||||
|
@ -253,12 +251,10 @@ class TestTaskGroup(unittest.IsolatedAsyncioTestCase):
|
|||
await asyncio.sleep(0.1)
|
||||
|
||||
self.assertFalse(r.done())
|
||||
r.cancel("test")
|
||||
r.cancel()
|
||||
with self.assertRaises(asyncio.CancelledError) as cm:
|
||||
await r
|
||||
|
||||
self.assertEqual(cm.exception.args, ('test',))
|
||||
|
||||
async def test_taskgroup_09(self):
|
||||
|
||||
t1 = t2 = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue