]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)
authorMark Shannon <mark@hotpy.org>
Tue, 24 Jan 2023 17:25:37 +0000 (17:25 +0000)
committerGitHub <noreply@github.com>
Tue, 24 Jan 2023 17:25:37 +0000 (17:25 +0000)
commitf02fa64bf2d03ef7a28650c164e17a5fb5d8543d
treea794d0afb47c84bf9a77d4feaa26e8e1fb23be07
parentdaec3a463c747c852d7ee91e82770fb1763d7d31
GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. (GH-101013)

* Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
Doc/library/dis.rst
Lib/importlib/_bootstrap_external.py
Lib/test/test_dis.py
Misc/NEWS.d/next/Core and Builtins/2023-01-13-12-56-20.gh-issue-100762.YvHaQJ.rst [new file with mode: 0644]
Objects/genobject.c
Python/bytecodes.c
Python/compile.c
Python/generated_cases.c.h
Python/opcode_metadata.h