fix error with python exceptions in BPy_errors_to_report
authorCampbell Barton <ideasman42@gmail.com>
Tue, 10 Nov 2009 16:17:49 +0000 (16:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 10 Nov 2009 16:17:49 +0000 (16:17 +0000)
source/blender/python/intern/bpy_util.c

index 86407e0c8185ec6ab57c6bf25159250ff53b0f57..174d1aa342f4ddfbc964fbb31c0a6813c47d662e 100644 (file)
@@ -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");