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:
authorCampbell Barton <ideasman42@gmail.com>2011-02-22 11:29:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-22 11:29:25 +0300
commit8186ba15abe4da9e055c94024a41342f3fd0cd14 (patch)
tree91be5b4110556b74f4fcc7e4432bbcdd3226ac68
parentd82ff93fa57dca44e7892791a53582d86aae9b2e (diff)
last commit used py3.2 function, inline for py3.1
-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;