diff options
author | Brett Cannon <brett@python.org> | 2022-04-17 22:02:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-17 22:02:36 (GMT) |
commit | ceea0715df33ae6dc3931670b4b749432d4e9707 (patch) | |
tree | 9ec3ddb969b2705c66ef25d208b13ead72430b94 | |
parent | d5a69571f586080af4c29671c47f9c4bc671af7f (diff) | |
download | cpython-ceea0715df33ae6dc3931670b4b749432d4e9707.zip cpython-ceea0715df33ae6dc3931670b4b749432d4e9707.tar.gz cpython-ceea0715df33ae6dc3931670b4b749432d4e9707.tar.bz2 |
gh-91217: deprecate ossaudiodev (GH-91641)
Automerge-Triggered-By: GH:brettcannon
-rw-r--r-- | Doc/whatsnew/3.11.rst | 1 | ||||
-rw-r--r-- | Lib/test/test_ossaudiodev.py | 5 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-04-17-11-56-17.gh-issue-91217.McJre3.rst | 1 | ||||
-rw-r--r-- | Modules/ossaudiodev.c | 7 |
4 files changed, 13 insertions, 1 deletions
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index bedf80a..27a5a0f 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -884,6 +884,7 @@ Deprecated * :mod:`msilib` * :mod:`nis` * :mod:`nntplib` + * :mod:`ossaudiodev` (Contributed by Brett Cannon in :issue:`47061`.) diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py index 37d2d1f..3275333 100644 --- a/Lib/test/test_ossaudiodev.py +++ b/Lib/test/test_ossaudiodev.py @@ -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 diff --git a/Misc/NEWS.d/next/Library/2022-04-17-11-56-17.gh-issue-91217.McJre3.rst b/Misc/NEWS.d/next/Library/2022-04-17-11-56-17.gh-issue-91217.McJre3.rst new file mode 100644 index 0000000..86ad05f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-04-17-11-56-17.gh-issue-91217.McJre3.rst @@ -0,0 +1 @@ +Deprecate the ossaudiodev module. diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c index 172a6e4..3926831 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -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; |