diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-30 09:26:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-30 09:26:08 +0400 |
commit | 79871ded0bd3e9cd5d7693ba683724cdb07121c3 (patch) | |
tree | 162e8278b8007cf3fd2e40e0e8d040ab0e99bddf /source/blender | |
parent | 5edbaab4f0c7b7fc589df0fa5285af5d225364e1 (diff) |
fix for finding the python exception line number when running a script in the text editor.
- filename comparison was invalid
- was stopping on the first traceback, which would reference the caller but not the error line (when the error was in a function).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy_traceback.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index 0e3162e09a4..f7aa6e0880b 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -155,12 +155,13 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset) { PyObject *coerce; const char *tb_filepath = traceback_filepath(tb, &coerce); - const int match = BLI_path_cmp(tb_filepath, filepath) != 0; + const int match = ((BLI_path_cmp(tb_filepath, filepath) == 0) || + ((tb_filepath[0] == '\\' || tb_filepath[0] == '/') && BLI_path_cmp(tb_filepath + 1, filepath) == 0)); Py_DECREF(coerce); if (match) { *lineno = tb->tb_lineno; - break; + /* used to break here, but better find the inner most line */ } } } |