Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* :mod:`ossaudiodev`
* :mod:`pipes`
* :mod:`sndhdr`
+ * :mod:`spwd`
(Contributed by Brett Cannon in :issue:`47061`.)
import os
import unittest
from test.support import import_helper
+import warnings
-spwd = import_helper.import_module('spwd')
+with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ spwd = import_helper.import_module('spwd')
@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
--- /dev/null
+Deprecate the spwd module.
PyMODINIT_FUNC
PyInit_spwd(void)
{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "'spwd' is deprecated and slated for removal in "
+ "Python 3.13",
+ 7)) {
+ return NULL;
+ }
+
return PyModuleDef_Init(&spwdmodule);
}