]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-101454: fix documentation for END_ASYNC_FOR (#101455) (#101493)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Wed, 1 Feb 2023 14:30:48 +0000 (14:30 +0000)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 14:30:48 +0000 (14:30 +0000)
gh-101454: fix documentation for END_ASYNC_FOR (#101455)

(cherry picked from commit 62251c3da06eb4662502295697f39730565b1717)

Doc/library/dis.rst

index 1e323bd50066b72067e36240f3dec9db1ba73eb3..a61dd75cbeab671a0f299ca0320eb1687cff75b4 100644 (file)
@@ -563,10 +563,9 @@ the original TOS1.
 .. opcode:: END_ASYNC_FOR
 
    Terminates an :keyword:`async for` loop.  Handles an exception raised
-   when awaiting a next item.  If TOS is :exc:`StopAsyncIteration` pop 3
-   values from the stack and restore the exception state using the second
-   of them.  Otherwise re-raise the exception using the value
-   from the stack.  An exception handler block is removed from the block stack.
+   when awaiting a next item. The stack contains the async iterable in
+   TOS1 and the raised exception in TOS. Both are popped.
+   If the exception is not :exc:`StopAsyncIteration`, it is re-raised.
 
    .. versionadded:: 3.8