gh-91217: deprecate ossaudiodev (GH-91641)

Automerge-Triggered-By: GH:brettcannon
This commit is contained in:
Brett Cannon 2022-04-17 15:02:36 -07:00 committed by GitHub
parent d5a69571f5
commit ceea0715df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -884,6 +884,7 @@ Deprecated
* :mod:`msilib`
* :mod:`nis`
* :mod:`nntplib`
* :mod:`ossaudiodev`
(Contributed by Brett Cannon in :issue:`47061`.)

View File

@ -1,10 +1,13 @@
from test import support
from test.support import import_helper, warnings_helper
import warnings
support.requires('audio')
from test.support import findfile
ossaudiodev = import_helper.import_module('ossaudiodev')
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
ossaudiodev = import_helper.import_module('ossaudiodev')
audioop = warnings_helper.import_deprecated('audioop')
import errno

View File

@ -0,0 +1 @@
Deprecate the ossaudiodev module.

View File

@ -1117,6 +1117,13 @@ PyInit_ossaudiodev(void)
{
PyObject *m;
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"'ossaudiodev' is deprecated and slated for removal in "
"Python 3.13",
7)) {
return NULL;
}
if (PyType_Ready(&OSSAudioType) < 0)
return NULL;