summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index c89f81f..6322af5 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -924,15 +924,19 @@ static PyObject *
call_trampoline(PyThreadState *tstate, PyObject* callback,
PyFrameObject *frame, int what, PyObject *arg)
{
- if (PyFrame_FastToLocalsWithError(frame) < 0) {
- return NULL;
- }
PyObject *stack[3];
stack[0] = (PyObject *)frame;
stack[1] = whatstrings[what];
stack[2] = (arg != NULL) ? arg : Py_None;
+ /* Discard any previous modifications the frame's fast locals */
+ if (frame->f_fast_as_locals) {
+ if (PyFrame_FastToLocalsWithError(frame) < 0) {
+ return NULL;
+ }
+ }
+
/* call the Python-level function */
PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3);