Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
deprecate ossaudiodev
  • Loading branch information
brettcannon committed Apr 17, 2022
commit 8f5c416b08ed527faa3efa472ef06a4110faabe0
1 change: 1 addition & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ Deprecated
* :mod:`msilib`
* :mod:`nis`
* :mod:`nntplib`
* :mod:`ossaudiodev`

(Contributed by Brett Cannon in :issue:`47061`.)

Expand Down
5 changes: 4 additions & 1 deletion Lib/test/test_ossaudiodev.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the ossaudiodev module.
7 changes: 7 additions & 0 deletions Modules/ossaudiodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down