aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/codegen.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-09-12 19:58:32 +0100
committerGitHub <noreply@github.com>2024-09-12 19:58:32 +0100
commit8145ebea587284db3be3f152ee0298952977d6f4 (patch)
tree1e636a9a54228474a6889f43bd59a88d77693a1d /Python/codegen.c
parentb2afe2aae487ebf89897e22c01d9095944fd334f (diff)
downloadcpython-8145ebea587284db3be3f152ee0298952977d6f4.tar.gz
cpython-8145ebea587284db3be3f152ee0298952977d6f4.zip
gh-124013: remove _PyCompile_IsTopLevelAwait (#124014)
Diffstat (limited to 'Python/codegen.c')
-rw-r--r--Python/codegen.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/Python/codegen.c b/Python/codegen.c
index fd2260a538f..9ce4e1fb1f6 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -65,7 +65,6 @@
struct _PyCompiler;
typedef struct _PyCompiler compiler;
-#define IS_TOP_LEVEL_AWAIT(C) _PyCompile_IsTopLevelAwait(C)
#define INSTR_SEQUENCE(C) _PyCompile_InstrSequence(C)
#define FUTURE_FEATURES(C) _PyCompile_FutureFeatures(C)
#define SYMTABLE(C) _PyCompile_Symtable(C)
@@ -4497,10 +4496,6 @@ codegen_comprehension(compiler *c, expr_ty e, int type,
PyCodeObject *co = NULL;
_PyCompile_InlinedComprehensionState inline_state = {NULL, NULL, NULL, NO_LABEL};
comprehension_ty outermost;
-#ifndef NDEBUG
- int scope_type = SCOPE_TYPE(c);
- int is_top_level_await = IS_TOP_LEVEL_AWAIT(c);
-#endif
PySTEntryObject *entry = _PySymtable_Lookup(SYMTABLE(c), (void *)e);
if (entry == NULL) {
goto error;
@@ -4531,12 +4526,6 @@ codegen_comprehension(compiler *c, expr_ty e, int type,
}
Py_CLEAR(entry);
- assert (!is_async_comprehension ||
- type == COMP_GENEXP ||
- scope_type == COMPILE_SCOPE_ASYNC_FUNCTION ||
- scope_type == COMPILE_SCOPE_COMPREHENSION ||
- is_top_level_await);
-
if (type != COMP_GENEXP) {
int op;
switch (type) {
@@ -4961,11 +4950,6 @@ codegen_visit_expr(compiler *c, expr_ty e)
ADD_YIELD_FROM(c, loc, 0);
break;
case Await_kind:
- assert(IS_TOP_LEVEL_AWAIT(c) || (_PyST_IsFunctionLike(SYMTABLE_ENTRY(c)) && (
- SCOPE_TYPE(c) == COMPILE_SCOPE_ASYNC_FUNCTION ||
- SCOPE_TYPE(c) == COMPILE_SCOPE_COMPREHENSION
- )));
-
VISIT(c, expr, e->v.Await.value);
ADDOP_I(c, loc, GET_AWAITABLE, 0);
ADDOP_LOAD_CONST(c, loc, Py_None);