March 2003
Intermediate to advanced
656 pages
39h 30m
English
PyErr_Format
PyObject* PyErr_Format(PyObject*type,char*format,...)
Raises an exception of class
type, a built-in such as
PyExc_IndexError, or an exception class created
with PyErr_NewException. Builds the associated
value from format string format, which has
syntax similar to printf’s, and
the following C values indicated as variable arguments above. Returns
NULL, so your code can just call:
return PyErr_Format(PyExc_KeyError,
"Unknown key name (%s)", thekeystring);Read now
Unlock full access