diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index 8dfc1ec72b4..3fc1ec140c6 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -75,7 +75,7 @@ void PyC_FileAndNum(const char **filename, int *lineno) /* when executing a script */ if (filename) { - co_filename= PyC_Object_GetAttrStringArgs(frame, 1, "f_code", "co_filename"); + co_filename= PyC_Object_GetAttrStringArgs(frame, 2, "f_code", "co_filename"); if (co_filename==NULL) { PyErr_SetString(PyExc_SystemError, "Could not access sys._getframe().f_code.co_filename"); Py_DECREF(frame);