diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-20 04:48:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-20 04:48:00 +0400 |
commit | 445279524a6c10fc09cd365a63fa9b69e364be83 (patch) | |
tree | 3097d3e39f13161a7fc807710a6ab687fcfd40f2 /source/blender/python/generic | |
parent | 4512f10db981bdd9083bd6763fc993f2a162ac53 (diff) |
debug build option WITH_PYTHON_UI_INFO, so you can right click and edit the python source for UI layout directly.
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r-- | source/blender/python/generic/py_capi_utils.c | 9 | ||||
-rw-r--r-- | source/blender/python/generic/py_capi_utils.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index 1bccc8a24c4..e658532db24 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -184,6 +184,15 @@ void PyC_FileAndNum(const char **filename, int *lineno) } } +void PyC_FileAndNum_Safe(const char **filename, int *lineno) +{ + if(!PYC_INTERPRETER_ACTIVE) { + return; + } + + PyC_FileAndNum(filename, lineno); +} + /* Would be nice if python had this built in */ PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...) { diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h index 03a8637710e..f38ce209be2 100644 --- a/source/blender/python/generic/py_capi_utils.h +++ b/source/blender/python/generic/py_capi_utils.h @@ -36,6 +36,7 @@ PyObject * PyC_ExceptionBuffer(void); PyObject * PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...); PyObject * PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *format, ...); void PyC_FileAndNum(const char **filename, int *lineno); +void PyC_FileAndNum_Safe(const char **filename, int *lineno); /* checks python is running */ int PyC_AsArray(void *array, PyObject *value, const int length, const PyTypeObject *type, const short is_double, const char *error_prefix); /* follow http://www.python.org/dev/peps/pep-0383/ */ |