+ use dedicated exception classes for expression and parsing errors

This commit is contained in:
wmayer
2015-09-27 23:17:33 +02:00
parent 6b67d4a4e7
commit c114c648fc
4 changed files with 103 additions and 35 deletions

View File

@@ -611,8 +611,9 @@ int DocumentPy::setCustomAttributes(const char* attr, PyObject *)
std::stringstream str;
str << "'Document' object attribute '" << attr
<< "' must not be set this way" << std::ends;
throw Py::AttributeError(str.str());
PyErr_SetString(PyExc_RuntimeError, str.str().c_str());
return -1;
}
return 0;
}