mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-131666: mark anext_awaitable.close
as a METH_NOARGS
instead of METH_VARARGS
(#131671)
This commit is contained in:
parent
c3b8d73208
commit
1393bd3548
3 changed files with 20 additions and 6 deletions
|
@ -1191,6 +1191,17 @@ class CoroutineTest(unittest.TestCase):
|
|||
_, result = run_async(g())
|
||||
self.assertIsNone(result.__context__)
|
||||
|
||||
def test_await_17(self):
|
||||
# See https://github.com/python/cpython/issues/131666 for details.
|
||||
class A:
|
||||
async def __anext__(self):
|
||||
raise StopAsyncIteration
|
||||
def __aiter__(self):
|
||||
return self
|
||||
|
||||
anext_awaitable = anext(A(), "a").__await__()
|
||||
self.assertRaises(TypeError, anext_awaitable.close, 1)
|
||||
|
||||
def test_with_1(self):
|
||||
class Manager:
|
||||
def __init__(self, name):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue