]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91217: deprecate ossaudiodev (GH-91641)
authorBrett Cannon <brett@python.org>
Sun, 17 Apr 2022 22:02:36 +0000 (15:02 -0700)
committerGitHub <noreply@github.com>
Sun, 17 Apr 2022 22:02:36 +0000 (15:02 -0700)
Automerge-Triggered-By: GH:brettcannon
Doc/whatsnew/3.11.rst
Lib/test/test_ossaudiodev.py
Misc/NEWS.d/next/Library/2022-04-17-11-56-17.gh-issue-91217.McJre3.rst [new file with mode: 0644]
Modules/ossaudiodev.c

index bedf80a72fab5c22a10b769858f06d469044c92f..27a5a0fc3d68715d3479e987f249e81534ad10e1 100644 (file)
@@ -884,6 +884,7 @@ Deprecated
   * :mod:`msilib`
   * :mod:`nis`
   * :mod:`nntplib`
+  * :mod:`ossaudiodev`
 
   (Contributed by Brett Cannon in :issue:`47061`.)
 
index 37d2d1f5ff44192392a2126cab53eec9e1f5aad5..3275333545882127aab9e5d57486d116e9c7ba72 100644 (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
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 (file)
index 0000000..86ad05f
--- /dev/null
@@ -0,0 +1 @@
+Deprecate the ossaudiodev module.
index 172a6e42975310c51cf9f0a57a187e35a4260150..3926831e0c0d9f2469ab14fc73afe71e3c5ba63c 100644 (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;