1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-05 19:01:18 +03:00

Deprecate old HTML SAX API

This commit is contained in:
Nick Wellnhofer
2022-08-25 20:18:16 +02:00
parent 51035c539e
commit a308c0cdf7
4 changed files with 20 additions and 3 deletions

View File

@ -1557,6 +1557,7 @@ libxml_htmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
const char *encoding;
PyObject *pyobj_SAX = NULL;
xmlSAXHandlerPtr SAX = NULL;
htmlParserCtxtPtr ctxt;
if (!PyArg_ParseTuple
(args, (char *) "Osz:htmlSAXParseFile", &pyobj_SAX, &URI,
@ -1574,7 +1575,9 @@ libxml_htmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
SAX = &pythonSaxHandler;
Py_INCREF(pyobj_SAX);
/* The reference is released in pythonEndDocument() */
htmlSAXParseFile(URI, encoding, SAX, pyobj_SAX);
ctxt = htmlNewSAXParserCtxt(SAX, pyobj_SAX);
htmlCtxtReadFile(ctxt, URI, encoding, 0);
htmlFreeParserCtxt(ctxt);
Py_INCREF(Py_None);
return (Py_None);
#else