68
71
PyErr_Clear(); // clear any existing exceptions
70
73
std::string json_in_cpp = writer.write(json_value);
71
char sss[4] = {'s', 's', 's', '\0'}; // gotta love C (dodge compiler warning)
72
75
PyObject* error_handler_function = GetPyErrorHandler();
73
76
PyObject* json_out_py = PyObject_CallFunction // call the Python ErrorHandler
75
78
json_in_cpp.c_str(), class_name.c_str(), what.c_str());
76
79
Py_DECREF(error_handler_function);
78
81
if (!json_out_py) { // python ErrorHandler was set to raise the error
83
86
int ok = PyArg_Parse(json_out_py, "s", &json_str); // convert to string