[Python-checkins] r63336 - in python/trunk: Lib/plat-sunos5/SUNAUDIODEV.py Lib/test/test_py3kwarn.py Lib/test/test_sunaudiodev.py Misc/NEWS Modules/sunaudiodev.c

brett.cannon python-checkins at python.org
Fri May 16 02:10:24 CEST 2008


Author: brett.cannon
Date: Fri May 16 02:10:24 2008
New Revision: 63336

Log:
Deprecate sunaudiodev/SUNAUDIODEV for removal in 3.0.

Modified:
   python/trunk/Lib/plat-sunos5/SUNAUDIODEV.py
   python/trunk/Lib/test/test_py3kwarn.py
   python/trunk/Lib/test/test_sunaudiodev.py
   python/trunk/Misc/NEWS
   python/trunk/Modules/sunaudiodev.c

Modified: python/trunk/Lib/plat-sunos5/SUNAUDIODEV.py
==============================================================================
--- python/trunk/Lib/plat-sunos5/SUNAUDIODEV.py	(original)
+++ python/trunk/Lib/plat-sunos5/SUNAUDIODEV.py	Fri May 16 02:10:24 2008
@@ -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.
 

Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py	(original)
+++ python/trunk/Lib/test/test_py3kwarn.py	Fri May 16 02:10:24 2008
@@ -151,7 +151,9 @@
                                       'Explorer', 'Finder', 'Netscape',
                                       'StdSuites', 'SystemEvents', 'Terminal',
                                       'cfmfile', 'bundlebuilder', 'buildtools',
-                                      'ColorPicker')}
+                                      'ColorPicker'),
+                           'sunos5' : ('sunaudiodev', 'SUNAUDIODEV'),
+                          }
     optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop',
                         'sv')
 

Modified: python/trunk/Lib/test/test_sunaudiodev.py
==============================================================================
--- python/trunk/Lib/test/test_sunaudiodev.py	(original)
+++ python/trunk/Lib/test/test_sunaudiodev.py	Fri May 16 02:10:24 2008
@@ -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:

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri May 16 02:10:24 2008
@@ -37,6 +37,9 @@
 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.

Modified: python/trunk/Modules/sunaudiodev.c
==============================================================================
--- python/trunk/Modules/sunaudiodev.c	(original)
+++ python/trunk/Modules/sunaudiodev.c	Fri May 16 02:10:24 2008
@@ -452,6 +452,10 @@
 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)


More information about the Python-checkins mailing list