Skip to content

Commit ceea071

Browse files
authored
gh-91217: deprecate ossaudiodev (GH-91641)
Automerge-Triggered-By: GH:brettcannon
1 parent d5a6957 commit ceea071

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ Deprecated
884884
* :mod:`msilib`
885885
* :mod:`nis`
886886
* :mod:`nntplib`
887+
* :mod:`ossaudiodev`
887888

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

Lib/test/test_ossaudiodev.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from test import support
22
from test.support import import_helper, warnings_helper
3+
import warnings
34
support.requires('audio')
45

56
from test.support import findfile
67

7-
ossaudiodev = import_helper.import_module('ossaudiodev')
8+
with warnings.catch_warnings():
9+
warnings.simplefilter("ignore", DeprecationWarning)
10+
ossaudiodev = import_helper.import_module('ossaudiodev')
811
audioop = warnings_helper.import_deprecated('audioop')
912

1013
import errno
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate the ossaudiodev module.

Modules/ossaudiodev.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,13 @@ PyInit_ossaudiodev(void)
11171117
{
11181118
PyObject *m;
11191119

1120+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
1121+
"'ossaudiodev' is deprecated and slated for removal in "
1122+
"Python 3.13",
1123+
7)) {
1124+
return NULL;
1125+
}
1126+
11201127
if (PyType_Ready(&OSSAudioType) < 0)
11211128
return NULL;
11221129

0 commit comments

Comments
 (0)