Skip to content

Commit 68e5f5c

Browse files
committed
Revert "Avoid a segfault when python code fails"
This reverts commit a1e826e.
1 parent 9b2be7a commit 68e5f5c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/python/qgspythonutilsimpl.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,7 @@ bool QgsPythonUtilsImpl::runStringUnsafe( const QString& command, bool single )
300300
// (non-unicode strings can be mangled)
301301
PyObject* obj = PyRun_String( command.toUtf8().data(), single ? Py_single_input : Py_file_input, mMainDict, mMainDict );
302302
bool res = nullptr == PyErr_Occurred();
303-
if ( obj )
304-
{
305-
Py_DECREF( obj );
306-
}
303+
Py_DECREF( obj );
307304

308305
// we are done calling python API, release global interpreter lock
309306
PyGILState_Release( gstate );

0 commit comments

Comments
 (0)