Neil Muller added the comment: Poking at the source of the error suggests the problem is in symtable.c:
The offending logic looks to be (around line 1124 in python 2.7 at revision 91767:4cef7b0ec659): if (s->v.Exec.globals) { ... } else { st->st_cur->ste_unoptimized |= OPT_BARE_EXEC; } since OPT_BARE_EXEC is the flag that triggers the exception. As far as I can see, this makes no provision for the exec() case, and only avoids setting OPT_BARE_EXEC if globals is specified using the old syntax. ---------- nosy: +Neil Muller _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21591> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com