]> granicus.if.org Git - python/commitdiff
Deprecate sunaudiodev/SUNAUDIODEV for removal in 3.0.
authorBrett Cannon <bcannon@gmail.com>
Fri, 16 May 2008 00:10:24 +0000 (00:10 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 16 May 2008 00:10:24 +0000 (00:10 +0000)
Lib/plat-sunos5/SUNAUDIODEV.py
Lib/test/test_py3kwarn.py
Lib/test/test_sunaudiodev.py
Misc/NEWS
Modules/sunaudiodev.c

index 632139f87d9b33a1bd38d6bfaeac5d20d6bba78b..25599bb882b98a29d43aedd81dfa3a861e3f8a99 100755 (executable)
@@ -1,6 +1,9 @@
 # Symbolic constants for use with sunaudiodev module
 # The names are the same as in audioio.h with the leading AUDIO_
 # removed.
+from warnings import warnpy3k
+warnpy3k("the SUNAUDIODEV module has been removed in Python 3.0", stacklevel=2)
+del warnpy3k
 
 # Not all values are supported on all releases of SunOS.
 
index b35314f12ffa80f4888d98c5a8dbe4655c906aaa..2561f2a4783f71b9b85c77a14726b6ecab7ce5c3 100644 (file)
@@ -151,7 +151,9 @@ class TestStdlibRemovals(unittest.TestCase):
                                       'Explorer', 'Finder', 'Netscape',
                                       'StdSuites', 'SystemEvents', 'Terminal',
                                       'cfmfile', 'bundlebuilder', 'buildtools',
-                                      'ColorPicker')}
+                                      'ColorPicker'),
+                           'sunos5' : ('sunaudiodev', 'SUNAUDIODEV'),
+                          }
     optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop',
                         'sv')
 
index 470fff82ec1838b111807c099d54d4618c7cb389..2c5e7d4a6e0e0efd99a539e114dcbb37ed1addd3 100644 (file)
@@ -1,5 +1,5 @@
-from test.test_support import findfile, TestFailed, TestSkipped
-import sunaudiodev
+from test.test_support import findfile, TestFailed, TestSkipped, import_module
+sunaudiodev = import_module('sunaudiodev', deprecated=True)
 import os
 
 try:
index 7d3dcff75cabd6f31c521752d785fb2776ba410d..95eeb2d48027f565ab67f98e7f1a294acc0241dd 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,9 @@ Extension Modules
 Library
 -------
 
+- The sunaudiodev and SUNAUDIODEV modules have been deprecated for removal in
+  Python 3.0.
+
 - The WAIT module from IRIX has been deprecated for removal in Python 3.0.
 
 - The torgb module from IRIX has been deprecated for removal in Python 3.0.
index 9f4c344f4c0e5d6b2dcdfc1dab5d3ed658480c25..285dc66ddda6a2f63089b00874bec033b9a3305a 100644 (file)
@@ -452,6 +452,10 @@ void
 initsunaudiodev(void)
 {
        PyObject *m, *d;
+       
+       if (PyErr_WarnPy3k("the sunaudiodev module has been removed in "
+                          "Python 3.0", 2) < 0)
+           return;
 
        m = Py_InitModule("sunaudiodev", sunaudiodev_methods);
        if (m == NULL)