1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +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

@@ -310,15 +310,21 @@ deprecated_funcs = {
'xmlNanoFTPProxy': True,
'xmlNanoFTPScanProxy': True,
'xmlNewGlobalNs': True,
'xmlParseEntity': True,
'xmlParseNamespace': True,
'xmlParseQuotedString': True,
'xmlParserHandleReference': True,
'xmlRecoverDoc': True,
'xmlRecoverFile': True,
'xmlRecoverMemory': True,
'xmlRelaxNGCleanupTypes': True,
'xmlRelaxNGInitTypes': True,
'xmlRemoveRef': True,
'xmlSAXDefaultVersion': True,
'xmlScanName': True,
'xmlSchemaCleanupTypes': True,
'xmlSchemaInitTypes': True,
'xmlSetupParserForBuffer': True,
'xmlThrDefDefaultBufferSize': True,
'xmlThrDefLineNumbersDefaultValue': True,
'xmlThrDefPedanticParserDefaultValue': True,

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);