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

Generate deprecation warnings for old SAX API

This commit is contained in:
Nick Wellnhofer
2022-08-25 19:53:04 +02:00
parent 7f7961df25
commit 51035c539e
4 changed files with 26 additions and 1 deletions

View File

@ -1524,6 +1524,7 @@ libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
const char *URI;
PyObject *pyobj_SAX = NULL;
xmlSAXHandlerPtr SAX = NULL;
xmlParserCtxtPtr ctxt;
if (!PyArg_ParseTuple(args, (char *) "Osi:xmlSAXParseFile", &pyobj_SAX,
&URI, &recover))
@ -1540,7 +1541,9 @@ libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
SAX = &pythonSaxHandler;
Py_INCREF(pyobj_SAX);
/* The reference is released in pythonEndDocument() */
xmlSAXUserParseFile(SAX, pyobj_SAX, URI);
ctxt = xmlNewSAXParserCtxt(SAX, pyobj_SAX);
xmlCtxtReadFile(ctxt, URI, NULL, 0);
xmlFreeParserCtxt(ctxt);
#endif /* LIBXML_SAX1_ENABLED */
Py_INCREF(Py_None);
return (Py_None);