[Bf-blender-cvs] [debb68024e0] master: PyAPI: add PyC_Err_SetString_Prefix for internal use

Campbell Barton noreply at git.blender.org
Wed Jan 16 22:48:42 CET 2019


Commit: debb68024e0a7c5a29fa709e939cdb1a05f95f05
Author: Campbell Barton
Date:   Thu Jan 17 08:38:59 2019 +1100
Branches: master
https://developer.blender.org/rBdebb68024e0a7c5a29fa709e939cdb1a05f95f05

PyAPI: add PyC_Err_SetString_Prefix for internal use

===================================================================

M	source/blender/python/generic/py_capi_utils.c
M	source/blender/python/generic/py_capi_utils.h

===================================================================

diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 991a035f683..567738e6be2 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -455,6 +455,11 @@ PyObject *PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *for
 	return NULL;
 }
 
+PyObject *PyC_Err_SetString_Prefix(PyObject *exception_type_prefix, const char *str)
+{
+	return PyC_Err_Format_Prefix(exception_type_prefix, "%s", str);
+}
+
 /**
  * Use for Python callbacks run directly from C,
  * when we can't use normal methods of raising exceptions.
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 21e4ecf2e86..43e397153ff 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -38,7 +38,10 @@ PyObject *PyC_ExceptionBuffer(void);
 PyObject *PyC_ExceptionBuffer_Simple(void);
 PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
 PyObject *PyC_FrozenSetFromStrings(const char **strings);
+
 PyObject *PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *format, ...);
+PyObject *PyC_Err_SetString_Prefix(PyObject *exception_type_prefix, const char *str);
+
 void      PyC_Err_PrintWithFunc(PyObject *py_func);
 
 void	PyC_FileAndNum(const char **filename, int *lineno);



More information about the Bf-blender-cvs mailing list