| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -141,10 +141,6 @@ PyObject *_PyCompile_Qualname(struct _PyCompiler *c); | |||
| 141 | 141 | _PyCompile_CodeUnitMetadata *_PyCompile_Metadata(struct _PyCompiler *c); | |
| 142 | 142 | PyObject *_PyCompile_StaticAttributesAsTuple(struct _PyCompiler *c); | |
| 143 | 143 | ||
| 144 | - #ifndef NDEBUG | ||
| 145 | - int _PyCompile_IsTopLevelAwait(struct _PyCompiler *c); | ||
| 146 | - #endif | ||
| 147 | - | ||
| 148 | 144 | struct symtable *_PyCompile_Symtable(struct _PyCompiler *c); | |
| 149 | 145 | PySTEntryObject *_PyCompile_SymtableEntry(struct _PyCompiler *c); | |
| 150 | 146 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,6 @@ | |||
| 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); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1242,15 +1242,6 @@ _PyCompile_Metadata(compiler *c) | |||
| 1242 | 1242 | return &c->u->u_metadata; | |
| 1243 | 1243 | } | |
| 1244 | 1244 | ||
| 1245 | - #ifndef NDEBUG | ||
| 1246 | - int | ||
| 1247 | - _PyCompile_IsTopLevelAwait(compiler *c) | ||
| 1248 | - { | ||
| 1249 | - return c->c_flags.cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT && | ||
| 1250 | - c->u->u_ste->ste_type == ModuleBlock; | ||
| 1251 | - } | ||
| 1252 | - #endif | ||
| 1253 | - | ||
| 1254 | 1245 | // Merge *obj* with constant cache, without recursion. | |
| 1255 | 1246 | int | |
| 1256 | 1247 | _PyCompile_ConstCacheMergeOne(PyObject *const_cache, PyObject **obj) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments