From df0a7170378f8fe22589e5fa3ec4f703b2e09d60 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sun, 11 May 2008 00:50:51 +0000 Subject: The linuxaudidev module has been deprecated for removal in Python 3.0. --- Doc/library/undoc.rst | 2 ++ Lib/test/test_linuxaudiodev.py | 2 +- Lib/test/test_py3kwarn.py | 2 +- Misc/NEWS | 2 ++ Modules/linuxaudiodev.c | 4 ++++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Doc/library/undoc.rst b/Doc/library/undoc.rst index deff5e2..7da1b3b 100644 --- a/Doc/library/undoc.rst +++ b/Doc/library/undoc.rst @@ -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). diff --git a/Lib/test/test_linuxaudiodev.py b/Lib/test/test_linuxaudiodev.py index 303490b..813df6f 100644 --- a/Lib/test/test_linuxaudiodev.py +++ b/Lib/test/test_linuxaudiodev.py @@ -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 diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 3371697..6835fa8 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index 12adf3d..9471c52 100644 --- 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. diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c index 730ec0c..80077c6 100644 --- a/Modules/linuxaudiodev.c +++ b/Modules/linuxaudiodev.c @@ -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) -- cgit v0.12