Coverity: Uncaught exception

This commit is contained in:
wmayer
2020-07-19 18:22:16 +02:00
parent 2ee8ad1854
commit 43d9e82f97
4 changed files with 42 additions and 7 deletions

View File

@@ -125,7 +125,7 @@ PyObject * Exception::getPyObject(void)
void Exception::setPyObject( PyObject * pydict)
{
if (pydict!=NULL) {
if (pydict && Py::_Dict_Check(pydict)) {
Py::Dict edict(pydict);
if (edict.hasKey("sfile"))
_file = static_cast<std::string>(Py::String(edict.getItem("sfile")));