summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorDirkjan Ochtman <dirkjan@ochtman.nl>2014-07-29 15:21:39 (GMT)
committerDirkjan Ochtman <dirkjan@ochtman.nl>2014-07-29 15:21:39 (GMT)
commit9b1d670361215f8d56de7a05cb1d430009735fd5 (patch)
tree66761b1a850a46ce95d9874d52674760c99df66f /Python/ceval.c
parentc3828075598ca775555b29b78e67d3fa8e856c00 (diff)
downloadcpython-9b1d670361215f8d56de7a05cb1d430009735fd5.zip
cpython-9b1d670361215f8d56de7a05cb1d430009735fd5.tar.gz
cpython-9b1d670361215f8d56de7a05cb1d430009735fd5.tar.bz2
Issue #21591: Handle exec backwards compatibility in the AST builder.
Instead of deferring until runtime. This makes sure we hit the right conditions in dealing with unqualified exec statements. Reviewed by Victor Stinner. Test follows in a later commit.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index e008608..38f51fa 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4673,18 +4673,9 @@ static int
exec_statement(PyFrameObject *f, PyObject *prog, PyObject *globals,
PyObject *locals)
{
- int n;
PyObject *v;
int plain = 0;
- if (PyTuple_Check(prog) && globals == Py_None && locals == Py_None &&
- ((n = PyTuple_Size(prog)) == 2 || n == 3)) {
- /* Backward compatibility hack */
- globals = PyTuple_GetItem(prog, 1);
- if (n == 3)
- locals = PyTuple_GetItem(prog, 2);
- prog = PyTuple_GetItem(prog, 0);
- }
if (globals == Py_None) {
globals = PyEval_GetGlobals();
if (locals == Py_None) {