Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-04-01 02:09:43 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-04-01 02:09:43 +0400
commit4c36a26af5d1093badc88401bfebf8454fdf0f34 (patch)
tree2e82fc5ff893651982d20ffdd15d4c69bfcbe7b8 /source/blender/python/intern/bpy_traceback.c
parent3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (diff)
parent8f949dd58decac45fd49f9a93152f2cddc98d901 (diff)
Merged changes in the trunk up to revision 45308.
Conflicts resolved: source/blender/editors/interface/resources.c source/blender/editors/mesh/editmesh_select.c source/blender/editors/space_view3d/drawobject.c
Diffstat (limited to 'source/blender/python/intern/bpy_traceback.c')
-rw-r--r--source/blender/python/intern/bpy_traceback.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c
index aaba90604f5..f7aa6e0880b 100644
--- a/source/blender/python/intern/bpy_traceback.c
+++ b/source/blender/python/intern/bpy_traceback.c
@@ -42,7 +42,7 @@ static const char *traceback_filepath(PyTracebackObject *tb, PyObject **coerce)
/* copied from pythonrun.c, 3.2.0 */
static int
parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
- int *lineno, int *offset, const char **text)
+ int *lineno, int *offset, const char **text)
{
long hold;
PyObject *v;
@@ -50,7 +50,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
/* old style errors */
if (PyTuple_Check(err))
return PyArg_ParseTuple(err, "O(ziiz)", message, filename,
- lineno, offset, text);
+ lineno, offset, text);
/* new style errors. `err' is an instance */
@@ -96,7 +96,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
if (v == Py_None)
*text = NULL;
else if (!PyUnicode_Check(v) ||
- !(*text = _PyUnicode_AsString(v)))
+ !(*text = _PyUnicode_AsString(v)))
goto finally;
Py_DECREF(v);
return 1;
@@ -122,7 +122,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
/* no traceback available when SyntaxError.
* python has no api's to this. reference parse_syntax_error() from pythonrun.c */
PyErr_NormalizeException(&exception, &value, (PyObject **)&tb);
- PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
+ PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
if (value) { /* should always be true */
PyObject *message;
@@ -146,7 +146,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
}
else {
PyErr_NormalizeException(&exception, &value, (PyObject **)&tb);
- PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
+ PyErr_Restore(exception, value, (PyObject *)tb); /* takes away reference! */
PyErr_Print();
for (tb = (PyTracebackObject *)PySys_GetObject("last_traceback");
@@ -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 */
}
}
}