]> granicus.if.org Git - python/commitdiff
The linuxaudidev module has been deprecated for removal in Python 3.0.
authorBrett Cannon <bcannon@gmail.com>
Sun, 11 May 2008 00:50:51 +0000 (00:50 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 11 May 2008 00:50:51 +0000 (00:50 +0000)
Doc/library/undoc.rst
Lib/test/test_linuxaudiodev.py
Lib/test/test_py3kwarn.py
Misc/NEWS
Modules/linuxaudiodev.c

index deff5e2a166fb5e3e432f930ed222f2771bf0559..7da1b3b067a03a52135b0b99c97bfa0030869d67 100644 (file)
@@ -54,6 +54,8 @@ Multimedia
 :mod:`linuxaudiodev`
    --- Play audio data on the Linux audio device.  Replaced in Python 2.3 by the
    :mod:`ossaudiodev` module.
+   
+   .. warning:: The linuxaudiodev module has been removed in Python 3.0.
 
 :mod:`sunaudio`
    --- Interpret Sun audio headers (may become obsolete or a tool/demo).
index 303490bcdc57bf88356db490e36bcbfe5452eacc..813df6fc73211e7933b20aa76289eecd3c237ce1 100644 (file)
@@ -4,7 +4,7 @@ test_support.requires('audio')
 from test.test_support import findfile, TestSkipped, run_unittest
 
 import errno
-import linuxaudiodev
+linuxaudiodev = test_support.import_module('linuxaudiodev', deprecated=True)
 import sys
 import sunaudio
 import audioop
index 3371697a00c9018697d94416dce46ab872289b26..6835fa8efe2427720de8eef0127e325d60380beb 100644 (file)
@@ -133,7 +133,7 @@ class TestStdlibRemovals(unittest.TestCase):
                         'ihooks')
     inclusive_platforms = {'irix':('pure',)}
     # XXX Don't know if lib-tk is only installed if _tkinter is built.
-    optional_modules = ('bsddb185', 'Canvas', 'dl')
+    optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev')
 
     def check_removal(self, module_name, optional=False):
         """Make sure the specified module, when imported, raises a
index 12adf3d426301eda4ca90b337b75d265133079d2..9471c52bbdccae3b39d58dad3dfe80240a9c8a9e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Extension Modules
 Library
 -------
 
+- The linuxaudiodev module has been deprecated for removal in Python 3.0.
+
 - The ihooks module has been deprecated for removal in Python 3.0.
 
 - The fpformat module has been deprecated for removal in Python 3.0.
index 730ec0cde3fc79639341805bf8677d2ff12195a6..80077c6f1e89a95a3fd9f7da4f47b639dcf5a638 100644 (file)
@@ -469,6 +469,10 @@ void
 initlinuxaudiodev(void)
 {
     PyObject *m;
+    
+    if (PyErr_WarnPy3k("the linuxaudiodev module has been removed in "
+                    "Python 3.0; use the ossaudiodev module instead", 2) < 0)
+        return;
   
     m = Py_InitModule("linuxaudiodev", linuxaudiodev_methods);
     if (m == NULL)