PyAPI: add PyC_Err_SetString_Prefix for internal use

This commit is contained in:
2019-01-17 08:38:59 +11:00
parent 8ba86020cc
commit debb68024e
2 changed files with 8 additions and 0 deletions

View File

@@ -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.