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/generic/py_capi_utils.c')
-rw-r--r--source/blender/python/generic/py_capi_utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 8e8da87b85f..0b1ba799324 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -55,6 +55,18 @@ void PyC_LineSpit(void) {
fprintf(stderr, "%s:%d\n", filename, lineno);
}
+/* python 3.2 only, copied from frameobjec.c */
+#if PY_VERSION_HEX < 0x03020000
+int
+PyFrame_GetLineNumber(PyFrameObject *f)
+{
+ if (f->f_trace)
+ return f->f_lineno;
+ else
+ return PyCode_Addr2Line(f->f_code, f->f_lasti);
+}
+#endif
+
void PyC_FileAndNum(const char **filename, int *lineno)
{
PyFrameObject *frame;