summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-08-10 02:39:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-08-10 02:39:36 (GMT)
commitd2903bd682cdd772a59ac109754333ef0da3cb97 (patch)
tree6b361df4724eab54556f1a4a7bc7825ff5ab8cb8 /Python
parent25327d4d3bc1bab8b0263a44f8d8790ce03c7877 (diff)
downloadcpython-d2903bd682cdd772a59ac109754333ef0da3cb97.zip
cpython-d2903bd682cdd772a59ac109754333ef0da3cb97.tar.gz
cpython-d2903bd682cdd772a59ac109754333ef0da3cb97.tar.bz2
restore runtime exec test (#21591)
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 38f51fa..e008608 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4673,9 +4673,18 @@ 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) {