Automerge-Triggered-By: GH:brettcannon
* :mod:`crypt`
* :mod:`imghdr`
* :mod:`msilib`
+ * :mod:`nis`
* :mod:`nntplib`
(Contributed by Brett Cannon in :issue:`47061`.)
from test import support
from test.support import import_helper
import unittest
+import warnings
# Skip test if nis module does not exist.
-nis = import_helper.import_module('nis')
+with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ nis = import_helper.import_module('nis')
class NisTests(unittest.TestCase):
--- /dev/null
+Deprecate the nis module.
PyMODINIT_FUNC
PyInit_nis(void)
{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "'nis' is deprecated and slated for removal in "
+ "Python 3.13",
+ 7)) {
+ return NULL;
+ }
return PyModuleDef_Init(&nismodule);
}