Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e16c7ae

Browse files
committed
jcompile(): inherit the CO_GENERATOR_ALLOWED flag from the 'base'
compiling struct.
1 parent a1b3a47 commit e16c7ae

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3945,6 +3945,7 @@ jcompile(node *n, char *filename, struct compiling *base,
39453945
if (base->c_nested
39463946
|| (sc.c_symtable->st_cur->ste_type == TYPE_FUNCTION))
39473947
sc.c_nested = 1;
3948+
sc.c_flags |= base->c_flags & CO_GENERATOR_ALLOWED;
39483949
} else {
39493950
sc.c_private = NULL;
39503951
sc.c_future = PyNode_Future(n, filename);

0 commit comments

Comments
 (0)