]> granicus.if.org Git - python/commitdiff
Merged revisions 79317 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 23 Mar 2010 00:28:26 +0000 (00:28 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 23 Mar 2010 00:28:26 +0000 (00:28 +0000)
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.
........

Lib/test/test_ossaudiodev.py
Misc/ACKS
Misc/NEWS
Modules/ossaudiodev.c

index dda6137d19acf566a1791eaf7a85fd5ad60c6441..055ad6c167c6e849b743cc4a90146ba164c21965 100644 (file)
@@ -159,6 +159,15 @@ class OSSAudioDevTests(unittest.TestCase):
             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:
index 2ea5ab9f0dfc14e9e1f0def2ddecccd49bbd4b6d..e88db2ac0be7252dd128622cccb62f1d0baef949 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -359,6 +359,7 @@ Ben Jackson
 David Jacobs
 Kevin Jacobs
 Kjetil Jacobsen
+Bertrand Janin
 Geert Jansen
 Jack Jansen
 Bill Janssen
index f82919b43fd77a6092cf9d41d88b748857249f39..a39a7c8a6b9efc03e0a3efb1c1d143d208141214 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -17,6 +17,10 @@ Core and Builtins
 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.
index 7686902bb57a1206172c0d911c7686a048083b2a..6654d712e548c25f36d67f0024de350eb051af12 100644 (file)
@@ -986,11 +986,17 @@ static struct PyModuleDef ossaudiodevmodule = {
        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;