X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4eeb5705545653ef141ed803feb434618140221f..ff9ca1fd6fe7484adf7361b0e64df8cc34f8b842:/wxPython/src/gtk/html_wrap.cpp diff --git a/wxPython/src/gtk/html_wrap.cpp b/wxPython/src/gtk/html_wrap.cpp index a2f15dc94a..ad01de3dec 100644 --- a/wxPython/src/gtk/html_wrap.cpp +++ b/wxPython/src/gtk/html_wrap.cpp @@ -372,15 +372,17 @@ public: // First, make a new instance of the tag handler wxPyBeginBlockThreads(); - PyObject* arg = Py_BuildValue("()"); - PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL); + PyObject* arg = PyTuple_New(0); + PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg); Py_DECREF(arg); - wxPyEndBlockThreads(); - + // now figure out where it's C++ object is... wxPyHtmlWinTagHandler* thPtr; - if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) + if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) { + wxPyEndBlockThreads(); return; + } + wxPyEndBlockThreads(); // add it, parser->AddTagHandler(thPtr);