From: Benjamin Peterson Date: Sun, 10 Aug 2014 02:39:36 +0000 (-0700) Subject: restore runtime exec test (#21591) X-Git-Tag: v2.7.9rc1~314 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2903bd682cdd772a59ac109754333ef0da3cb97;p=thirdparty%2FPython%2Fcpython.git restore runtime exec test (#21591) --- diff --git a/Python/ceval.c b/Python/ceval.c index 38f51faf69c3..e00860831f15 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) {