diff options
-rw-r--r-- | source/blender/python/intern/bpy_util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index 86407e0c818..174d1aa342f 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -162,12 +162,15 @@ void BPY_getFileAndNum(char **filename, int *lineno) getframe = PySys_GetObject("_getframe"); // borrowed if (getframe==NULL) { + PyErr_Clear(); return; } frame = PyObject_CallObject(getframe, NULL); - if (frame==NULL) + if (frame==NULL) { + PyErr_Clear(); return; + } if (filename) { co_filename= PyObject_GetAttrStringArgs(frame, 1, "f_code", "co_filename"); |