[Python-checkins] r79318 - in python/branches/release31-maint: Lib/test/test_ossaudiodev.py Misc/ACKS Misc/NEWS Modules/ossaudiodev.c

antoine.pitrou python-checkins at python.org
Tue Mar 23 01:28:26 CET 2010


Author: antoine.pitrou
Date: Tue Mar 23 01:28:26 2010
New Revision: 79318

Log:
Merged revisions 79317 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r79317 | antoine.pitrou | 2010-03-23 01:25:54 +0100 (mar., 23 mars 2010) | 5 lines
  
  Issue #8139: ossaudiodev didn't initialize its types properly, therefore
  some methods (such as oss_mixer_device.fileno()) were not available.
  Initial patch by Bertrand Janin.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Lib/test/test_ossaudiodev.py
   python/branches/release31-maint/Misc/ACKS
   python/branches/release31-maint/Misc/NEWS
   python/branches/release31-maint/Modules/ossaudiodev.c

Modified: python/branches/release31-maint/Lib/test/test_ossaudiodev.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_ossaudiodev.py	(original)
+++ python/branches/release31-maint/Lib/test/test_ossaudiodev.py	Tue Mar 23 01:28:26 2010
@@ -159,6 +159,15 @@
             dsp.close()
             self.assertTrue(dsp.closed)
 
+    def test_mixer_methods(self):
+        # Issue #8139: ossaudiodev didn't initialize its types properly,
+        # therefore some methods were unavailable.
+        mixer = ossaudiodev.openmixer()
+        try:
+            self.assertGreaterEqual(mixer.fileno(), 0)
+        finally:
+            mixer.close()
+
 
 def test_main():
     try:

Modified: python/branches/release31-maint/Misc/ACKS
==============================================================================
--- python/branches/release31-maint/Misc/ACKS	(original)
+++ python/branches/release31-maint/Misc/ACKS	Tue Mar 23 01:28:26 2010
@@ -359,6 +359,7 @@
 David Jacobs
 Kevin Jacobs
 Kjetil Jacobsen
+Bertrand Janin
 Geert Jansen
 Jack Jansen
 Bill Janssen

Modified: python/branches/release31-maint/Misc/NEWS
==============================================================================
--- python/branches/release31-maint/Misc/NEWS	(original)
+++ python/branches/release31-maint/Misc/NEWS	Tue Mar 23 01:28:26 2010
@@ -17,6 +17,10 @@
 Library
 -------
 
+- Issue #8139: ossaudiodev didn't initialize its types properly, therefore
+  some methods (such as oss_mixer_device.fileno()) were not available.
+  Initial patch by Bertrand Janin.
+
 - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
   didn't support chflags() (for example ZFS under FreeBSD).  The error is
   now silenced.

Modified: python/branches/release31-maint/Modules/ossaudiodev.c
==============================================================================
--- python/branches/release31-maint/Modules/ossaudiodev.c	(original)
+++ python/branches/release31-maint/Modules/ossaudiodev.c	Tue Mar 23 01:28:26 2010
@@ -986,11 +986,17 @@
 	NULL
 };
 
-PyObject*
+PyMODINIT_FUNC
 PyInit_ossaudiodev(void)
 {
     PyObject *m;
 
+    if (PyType_Ready(&OSSAudioType) < 0)
+        return NULL;
+
+    if (PyType_Ready(&OSSMixerType) < 0)
+        return NULL;
+
     m = PyModule_Create(&ossaudiodevmodule);
     if (m == NULL)
 	return NULL;


More information about the Python-checkins mailing list