| 43 | using namespace Base; |
| 44 | |
| 45 | PyException::PyException(const Py::Object& obj) |
| 46 | { |
| 47 | setMessage(obj.as_string()); |
| 48 | // WARNING: we are assuming that python type object will never be |
| 49 | // destroyed, so we don't keep reference here to save book-keeping in |
| 50 | // our copy constructor and destructor |
| 51 | // NOLINTBEGIN |
| 52 | _exceptionType = reinterpret_cast<PyObject*>(obj.ptr()->ob_type); |
| 53 | _errorType = obj.ptr()->ob_type->tp_name; |
| 54 | // NOLINTEND |
| 55 | } |
| 56 | |
| 57 | PyException::PyException() |
| 58 | { |
nothing calls this directly
no test coverage detected