mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-05 19:01:18 +03:00
Warn when using deprecated functions from Python bindings
This requires Python code to be run with -Wd.
This commit is contained in:
@ -3822,6 +3822,23 @@ libxml_nodeHash(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Deprecation warnings *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
int
|
||||
libxml_deprecationWarning(const char *func) {
|
||||
#if PY_VERSION_HEX >= 0x03020000
|
||||
return PyErr_WarnFormat(PyExc_PendingDeprecationWarning, 1,
|
||||
"libxml2mod.%s is deprecated and will be removed "
|
||||
"in future versions", func);
|
||||
#else
|
||||
return PyErr_WarnEx(PyExc_PendingDeprecationWarning, func, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The registration stuff *
|
||||
|
Reference in New Issue
Block a user