bpo-37268: Add deprecation notice and a DeprecationWarning for the parser module (GH-15017)

Deprecate the parser module and add a deprecation warning triggered on import and a warning block in the documentation.





https://bugs.python.org/issue37268



Automerge-Triggered-By: @pablogsal
This commit is contained in:
Pablo Galindo 2019-07-30 12:04:01 +01:00 committed by Miss Islington (bot)
parent f35c51d2ea
commit 9211e2fd81
5 changed files with 25 additions and 4 deletions

View file

@ -1158,6 +1158,12 @@ PyInit_parser(void)
{
PyObject *module, *copyreg;
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"The parser module is deprecated and will be removed "
"in future versions of Python", 7) != 0) {
return NULL;
}
if (PyType_Ready(&PyST_Type) < 0)
return NULL;
module = PyModule_Create(&parsermodule);