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:
Diffstat (limited to 'source/blender/python/intern/bpy_traceback.c')
-rw-r--r--source/blender/python/intern/bpy_traceback.c116
1 files changed, 58 insertions, 58 deletions
diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c
index b5dec7205a6..1a6caa02b0c 100644
--- a/source/blender/python/intern/bpy_traceback.c
+++ b/source/blender/python/intern/bpy_traceback.c
@@ -38,68 +38,68 @@ static const char *traceback_filepath(PyTracebackObject *tb)
/* 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;
-
- /* old style errors */
- if (PyTuple_Check(err))
- return PyArg_ParseTuple(err, "O(ziiz)", message, filename,
- lineno, offset, text);
-
- /* new style errors. `err' is an instance */
-
- if (! (v = PyObject_GetAttrString(err, "msg")))
- goto finally;
- *message = v;
-
- if (!(v = PyObject_GetAttrString(err, "filename")))
- goto finally;
- if (v == Py_None)
- *filename = NULL;
- else if (! (*filename = _PyUnicode_AsString(v)))
- goto finally;
-
- Py_DECREF(v);
- if (!(v = PyObject_GetAttrString(err, "lineno")))
- goto finally;
- hold = PyLong_AsLong(v);
- Py_DECREF(v);
- v = NULL;
- if (hold < 0 && PyErr_Occurred())
- goto finally;
- *lineno = (int)hold;
-
- if (!(v = PyObject_GetAttrString(err, "offset")))
- goto finally;
- if (v == Py_None) {
- *offset = -1;
- Py_DECREF(v);
- v = NULL;
+ long hold;
+ PyObject *v;
+
+ /* old style errors */
+ if (PyTuple_Check(err))
+ return PyArg_ParseTuple(err, "O(ziiz)", message, filename,
+ lineno, offset, text);
+
+ /* new style errors. `err' is an instance */
+
+ if (! (v = PyObject_GetAttrString(err, "msg")))
+ goto finally;
+ *message = v;
+
+ if (!(v = PyObject_GetAttrString(err, "filename")))
+ goto finally;
+ if (v == Py_None)
+ *filename = NULL;
+ else if (! (*filename = _PyUnicode_AsString(v)))
+ goto finally;
+
+ Py_DECREF(v);
+ if (!(v = PyObject_GetAttrString(err, "lineno")))
+ goto finally;
+ hold = PyLong_AsLong(v);
+ Py_DECREF(v);
+ v = NULL;
+ if (hold < 0 && PyErr_Occurred())
+ goto finally;
+ *lineno = (int)hold;
+
+ if (!(v = PyObject_GetAttrString(err, "offset")))
+ goto finally;
+ if (v == Py_None) {
+ *offset = -1;
+ Py_DECREF(v);
+ v = NULL;
}
else {
- hold = PyLong_AsLong(v);
- Py_DECREF(v);
- v = NULL;
- if (hold < 0 && PyErr_Occurred())
- goto finally;
- *offset = (int)hold;
- }
-
- if (!(v = PyObject_GetAttrString(err, "text")))
- goto finally;
- if (v == Py_None)
- *text = NULL;
- else if (!PyUnicode_Check(v) ||
- !(*text = _PyUnicode_AsString(v)))
- goto finally;
- Py_DECREF(v);
- return 1;
+ hold = PyLong_AsLong(v);
+ Py_DECREF(v);
+ v = NULL;
+ if (hold < 0 && PyErr_Occurred())
+ goto finally;
+ *offset = (int)hold;
+ }
+
+ if (!(v = PyObject_GetAttrString(err, "text")))
+ goto finally;
+ if (v == Py_None)
+ *text = NULL;
+ else if (!PyUnicode_Check(v) ||
+ !(*text = _PyUnicode_AsString(v)))
+ goto finally;
+ Py_DECREF(v);
+ return 1;
finally:
- Py_XDECREF(v);
- return 0;
+ Py_XDECREF(v);
+ return 0;
}
/* end copied function! */
@@ -122,7 +122,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
if(value) { /* should always be true */
PyObject *message;
- const char *filename, *text;
+ const char *filename, *text;
if(parse_syntax_error(value, &message, &filename, lineno, offset, &text)) {
/* python adds a '/', prefix, so check for both */