summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-01-24 17:25:37 (GMT)
committerGitHub <noreply@github.com>2023-01-24 17:25:37 (GMT)
commitf02fa64bf2d03ef7a28650c164e17a5fb5d8543d (patch)
treea794d0afb47c84bf9a77d4feaa26e8e1fb23be07 /Python/generated_cases.c.h
parentdaec3a463c747c852d7ee91e82770fb1763d7d31 (diff)
downloadcpython-f02fa64bf2d03ef7a28650c164e17a5fb5d8543d.zip
cpython-f02fa64bf2d03ef7a28650c164e17a5fb5d8543d.tar.gz
cpython-f02fa64bf2d03ef7a28650c164e17a5fb5d8543d.tar.bz2
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.
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index c1eb400..5dcc8ee 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -919,7 +919,6 @@
// NOTE: It's important that YIELD_VALUE never raises an exception!
// The compiler treats any exception raised here as a failed close()
// or throw() call.
- assert(oparg == STACK_LEVEL());
assert(frame != &entry_frame);
PyGenObject *gen = _PyFrame_GetGenerator(frame);
gen->gi_frame_state = FRAME_SUSPENDED;