diff options
| author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-22 02:32:48 +0000 |
|---|---|---|
| committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-22 02:32:48 +0000 |
| commit | adb12ee4d6908d7871acf6a17efbe8db94a74f9c (patch) | |
| tree | 0b846fdc839cabc4d9941ca7a310b7a04c277575 /Python/compile.c | |
| parent | 4dfe81db172999a1408f9c55683e0ee161f91f30 (diff) | |
| download | cpython-adb12ee4d6908d7871acf6a17efbe8db94a74f9c.tar.gz | |
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.
Diffstat (limited to 'Python/compile.c')
| -rw-r--r-- | Python/compile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index cd936a3aff..81be103515 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4276,6 +4276,8 @@ static int 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) { |
