|
65 | 65 | struct _PyCompiler; |
66 | 66 | typedef struct _PyCompiler compiler; |
67 | 67 |
|
68 | | -#define IS_TOP_LEVEL_AWAIT(C) _PyCompile_IsTopLevelAwait(C) |
69 | 68 | #define INSTR_SEQUENCE(C) _PyCompile_InstrSequence(C) |
70 | 69 | #define FUTURE_FEATURES(C) _PyCompile_FutureFeatures(C) |
71 | 70 | #define SYMTABLE(C) _PyCompile_Symtable(C) |
@@ -4497,10 +4496,6 @@ codegen_comprehension(compiler *c, expr_ty e, int type, |
4497 | 4496 | PyCodeObject *co = NULL; |
4498 | 4497 | _PyCompile_InlinedComprehensionState inline_state = {NULL, NULL, NULL, NO_LABEL}; |
4499 | 4498 | comprehension_ty outermost; |
4500 | | -#ifndef NDEBUG |
4501 | | - int scope_type = SCOPE_TYPE(c); |
4502 | | - int is_top_level_await = IS_TOP_LEVEL_AWAIT(c); |
4503 | | -#endif |
4504 | 4499 | PySTEntryObject *entry = _PySymtable_Lookup(SYMTABLE(c), (void *)e); |
4505 | 4500 | if (entry == NULL) { |
4506 | 4501 | goto error; |
@@ -4531,12 +4526,6 @@ codegen_comprehension(compiler *c, expr_ty e, int type, |
4531 | 4526 | } |
4532 | 4527 | Py_CLEAR(entry); |
4533 | 4528 |
|
4534 | | - assert (!is_async_comprehension || |
4535 | | - type == COMP_GENEXP || |
4536 | | - scope_type == COMPILE_SCOPE_ASYNC_FUNCTION || |
4537 | | - scope_type == COMPILE_SCOPE_COMPREHENSION || |
4538 | | - is_top_level_await); |
4539 | | - |
4540 | 4529 | if (type != COMP_GENEXP) { |
4541 | 4530 | int op; |
4542 | 4531 | switch (type) { |
@@ -4961,11 +4950,6 @@ codegen_visit_expr(compiler *c, expr_ty e) |
4961 | 4950 | ADD_YIELD_FROM(c, loc, 0); |
4962 | 4951 | break; |
4963 | 4952 | case Await_kind: |
4964 | | - assert(IS_TOP_LEVEL_AWAIT(c) || (_PyST_IsFunctionLike(SYMTABLE_ENTRY(c)) && ( |
4965 | | - SCOPE_TYPE(c) == COMPILE_SCOPE_ASYNC_FUNCTION || |
4966 | | - SCOPE_TYPE(c) == COMPILE_SCOPE_COMPREHENSION |
4967 | | - ))); |
4968 | | - |
4969 | 4953 | VISIT(c, expr, e->v.Await.value); |
4970 | 4954 | ADDOP_I(c, loc, GET_AWAITABLE, 0); |
4971 | 4955 | ADDOP_LOAD_CONST(c, loc, Py_None); |
|
0 commit comments