mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
This commit is contained in:
parent
9a11ed8e50
commit
83a3de4e06
14 changed files with 125 additions and 21 deletions
|
@ -709,9 +709,16 @@ class CoroutineTest(unittest.TestCase):
|
|||
aw = coro.__await__()
|
||||
next(aw)
|
||||
with self.assertRaises(ZeroDivisionError):
|
||||
aw.throw(ZeroDivisionError, None, None)
|
||||
aw.throw(ZeroDivisionError())
|
||||
self.assertEqual(N, 102)
|
||||
|
||||
coro = foo()
|
||||
aw = coro.__await__()
|
||||
next(aw)
|
||||
with self.assertRaises(ZeroDivisionError):
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
aw.throw(ZeroDivisionError, ZeroDivisionError(), None)
|
||||
|
||||
def test_func_11(self):
|
||||
async def func(): pass
|
||||
coro = func()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue