Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 17124:a8301d4ed2b1 legacy-trunk
If a code object is compiled with nested scopes, define the CO_NESTED flag.
Add PyEval_GetNestedScopes() which returns a non-zero value if the
code for the current interpreter frame has CO_NESTED defined.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Thu, 22 Mar 2001 02:32:48 +0000 |
| parents | 76eab2ebce58 |
| children | 1c90a1cf795c |
line wrap: on
line diff
--- a/Python/compile.c Thu Mar 22 00:40:23 2001 +0000 +++ b/Python/compile.c Thu Mar 22 02:32:48 2001 +0000 @@ -4276,6 +4276,8 @@ symtable_update_flags(struct compiling *c, PySymtableEntryObject *ste, struct symbol_info *si) { + if (c->c_future && c->c_future->ff_nested_scopes) + c->c_flags |= CO_NESTED; if (ste->ste_type != TYPE_MODULE) c->c_flags |= CO_NEWLOCALS; if (ste->ste_type == TYPE_FUNCTION) {
