mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.13] GH-135171: Roll back all fixes for GH-127682 as they are not suitable for 3.13 (#135390)
This commit is contained in:
parent
5f5b173cc7
commit
6ae51582a1
7 changed files with 30 additions and 72 deletions
|
|
@ -2252,31 +2252,6 @@ def c():
|
|||
# before fixing, visible stack from throw would be shorter than from send.
|
||||
self.assertEqual(len_send, len_throw)
|
||||
|
||||
def test_call_aiter_once_in_comprehension(self):
|
||||
|
||||
class Iterator:
|
||||
|
||||
def __init__(self):
|
||||
self.val = 0
|
||||
|
||||
async def __anext__(self):
|
||||
if self.val == 2:
|
||||
raise StopAsyncIteration
|
||||
self.val += 1
|
||||
return self.val
|
||||
|
||||
# No __aiter__ method
|
||||
|
||||
class C:
|
||||
|
||||
def __aiter__(self):
|
||||
return Iterator()
|
||||
|
||||
async def run():
|
||||
return [i async for i in C()]
|
||||
|
||||
self.assertEqual(run_async(run()), ([], [1,2]))
|
||||
|
||||
|
||||
@unittest.skipIf(
|
||||
support.is_emscripten or support.is_wasi,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue