Anonymous avatar Anonymous committed e020b26

Merged to branch revision 2222

Comments (0)

Files changed (15)

 # Info taken from:
 # http://www.microsoft.com/typography/fonts/winxp.htm
 # with extra files added from:
-# <fill this in>
+# http://www.ampsoft.net/webdesign-l/windows-fonts-by-version.html
 # File name, family, (Bold, Italic)
 XP_default_font_files = [
-    ('ahronbd.ttf', 'Aharoni', (True, False)),
-    ('andlso.ttf', 'Andalus', (False, False)),
-    ('angsa.ttf', 'Angsana New', (False, False)),
-    ('angsab.ttf', 'Angsana New', (True, False)),
-    ('angsai.ttf', 'Angsana New', (False, True)),
-    ('angsaz.ttf', 'Angsana New', (True, True)),
-    ('angsau.ttf', 'AngsanaUPC', (False, False)),
-    ('angsaub.ttf', 'AngsanaUPC', (True, False)),
-    ('angsaui.ttf', 'AngsanaUPC', (False, True)),
-    ('angsauz.ttf', 'AngsanaUPC', (True, True)),
-    ('artro.ttf', 'Arabic Transparent', (False, False)),
-    ('artrbdo.ttf', 'Arabic Transparent', (True, False)),
-    ('agatha.ttf', 'Agatha', (False, False)),
-    ('arial.ttf', 'Arial', (False, False)),
-    ('arialbd.ttf', 'Arial', (True, False)),
-    ('ariali.ttf', 'Arial', (False, True)),
-    ('arialbi.ttf', 'Arial', (True, True)),
-    ('ariblk.ttf', 'Arial Black', (False, False)),
-    ('browa.ttf', 'Browallia New', (False, False)),
-    ('browab.ttf', 'Browallia New', (True, False)),
-    ('browai.ttf', 'Browallia New', (False, True)),
-    ('browaz.ttf', 'Browallia New', (True, True)),
-    ('browau.ttf', 'BrowalliaUPC', (False, False)),
-    ('browaub.ttf', 'BrowalliaUPC', (True, False)),
-    ('browaui.ttf', 'BrowalliaUPC', (False, True)),
-    ('browauz.ttf', 'BrowalliaUPC', (True, True)),
-    ('comic.ttf', 'Comic Sans MS', (False, False)),
-    ('comicbd.ttf', 'Comic Sans MS', (True, False)),
-    ('cordia.ttf', 'Cordia New', (False, False)),
-    ('cordiab.ttf', 'Cordia New', (True, False)),
-    ('cordiai.ttf', 'Cordia New', (False, True)),
-    ('cordiaz.ttf', 'Cordia New', (True, True)),
-    ('cordiau.ttf', 'CordiaUPC', (False, False)),
-    ('cordiaub.ttf', 'CordiaUPC', (True, False)),
-    ('cordiaui.ttf', 'CordiaUPC', (False, True)),
-    ('cordiauz.ttf', 'CordiaUPC', (True, True)),
-    ('cour.ttf', 'Courier New', (False, False)),
-    ('courbd.ttf', 'Courier New', (True, False)),
-    ('couri.ttf', 'Courier New', (False, True)),
-    ('courbi.ttf', 'Courier New', (True, True)),
-    ('david.ttf', 'David', (False, False)),
-    ('davidbd.ttf', 'David', (True, False)),
-    ('davidtr.ttf', 'David Transparent', (False, False)),
-    ('upcdl.ttf', 'DilleniaUPC', (False, False)),
-    ('upcdb.ttf', 'DilleniaUPC', (True, False)),
-    ('upcdi.ttf', 'DilleniaUPC', (False, True)),
-    ('upcdbi.ttf', 'DilleniaUPC', (True, True)),
-    ('estre.ttf', 'Estrangelo Edessa', (False, False)),
-    ('upcel.ttf', 'EucrosialUPC', (False, False)),
-    ('upceb.ttf', 'EucrosialUPC', (True, False)),
-    ('upcei.ttf', 'EucrosialUPC', (False, True)),
-    ('upcebi.ttf', 'EucrosialUPC', (True, True)),
-    ('mriamfx.ttf', 'Fixed Miriam Transparent', (False, False)),
-    ('framd.ttf', 'Franklin Gothic Medium', (False, False)),
-    ('framdit.ttf', 'Franklin Gothic Medium', (False, True)),
-    ('frank.ttf', 'FrankRuehl', (False, False)),
-    ('upcfl.ttf', 'FreesialUPC', (False, False)),
-    ('upcfb.ttf', 'FreesialUPC', (True, False)),
-    ('upcfi.ttf', 'FreesialUPC', (False, True)),
-    ('upcfbi.ttf', 'FreesialUPC', (True, True)),
-    ('gautami.ttf', 'Gautami', (False, False)),
-    ('georgia.ttf', 'Georgia', (False, False)),
-    ('georgiab.ttf', 'Georgia', (True, False)),
-    ('georgiai.ttf', 'Georgia', (False, True)),
-    ('georgiaz.ttf', 'Georgia', (True, True)),
-    ('impact.ttf', 'Impact', (False, False)),
-    ('upcil.ttf', 'IrisUPC', (False, False)),
-    ('upcib.ttf', 'IrisUPC', (True, False)),
-    ('upcii.ttf', 'IrisUPC', (False, True)),
-    ('upcibi.ttf', 'IrisUPC', (True, True)),
-    ('upcjl.ttf', 'JasmineUPC', (False, False)),
-    ('upcjb.ttf', 'JasmineUPC', (True, False)),
-    ('upcji.ttf', 'JasmineUPC', (False, True)),
-    ('upcjbi.ttf', 'JasmineUPC', (True, True)),
-    ('upckl.ttf', 'KodchiangUPC', (False, False)),
-    ('upckb.ttf', 'KodchiangUPC', (True, False)),
-    ('upcki.ttf', 'KodchiangUPC', (False, True)),
-    ('upckbi.ttf', 'KodchiangUPC', (True, True)),
-    ('latha.ttf', 'Latha', (False, False)),
-    ('lvnm.ttf', 'Levenim MT', (False, False)),
-    ('lvnmbd.ttf', 'Levenim MT', (True, False)),
-    ('upcll.ttf', 'LilyUPC', (False, False)),
-    ('upclb.ttf', 'LilyUPC', (True, False)),
-    ('upcli.ttf', 'LilyUPC', (False, True)),
-    ('upclbi.ttf', 'LilyUPC', (True, True)),
-    ('lucon.ttf', 'Lucida Console', (False, False)),
-    ('l_10646.ttf', 'Lucida Sans Unicode', (False, False)),
-    ('mangal.ttf', 'Mangal', (False, False)),
-    ('marlett.ttf', 'Marlett', (False, False)),
-    ('micross.ttf', 'Microsoft Sans Serif', (False, False)),
-    ('mriam.ttf', 'Miriam', (False, False)),
-    ('mriamc.ttf', 'Miriam Fixed', (False, False)),
-    ('mriamtr.ttf', 'Miriam Transparent', (False, False)),
-    ('mvboli.ttf', 'MV Boli', (False, False)),
-    ('nrkis.ttf', 'Narkisim', (False, False)),
-    ('pala.ttf', 'Falatino Linotype', (False, False)),
-    ('palab.ttf', 'Falatino Linotype', (True, False)),
-    ('palai.ttf', 'Falatino Linotype', (False, True)),
-    ('palabi.ttf', 'Falatino Linotype', (True, True)),
-    ('raavi.ttf', 'Raavi', (False, False)),
-    ('rod.ttf', 'Rod', (False, False)),
-    ('rodtr.ttf', 'Rod Transparent', (False, False)),
-    ('shruti.ttf', 'Shruti', (False, False)),
-    ('simpo.ttf', 'Simplified Arabic', (False, False)),
-    ('simpbdo.ttf', 'Simplified Arabic', (True, False)),
-    ('simpfxo.ttf', 'Simplified Arabic Fixed', (False, False)),
-    ('sylfaen.ttf', 'Sylfaen', (False, False)),
-    ('symbol.ttf', 'Symbol', (False, False)),
-    ('tahoma.ttf', 'Tahoma', (False, False)),
-    ('tahomabd.ttf', 'Tahoma', (True, False)),
-    ('times.ttf', 'Times New Roman', (False, False)),
-    ('timesbd.ttf', 'Times New Roman', (True, False)),
-    ('timesi.ttf', 'Times New Roman', (False, True)),
-    ('timesbi.ttf', 'Times New Roman', (True, True)),
-    ('trado.ttf', 'Traditional Arabic', (False, False)),
-    ('tradbdo.ttf', 'Traditional Arabic', (True, False)),
-    ('Trebuc.ttf', 'Trebuchet MS', (False, False)),
-    ('Trebucbd.ttf', 'Trebuchet MS', (True, False)),
-    ('Trebucit.ttf', 'Trebuchet MS', (False, True)),
-    ('Trebucbi.ttf', 'Trebuchet MS', (True, True)),
-    ('tunga.ttf', 'Tunga', (False, False)),
-    ('verdana.ttf', 'Verdana', (False, False)),
-    ('verdanab.ttf', 'Verdana', (True, False)),
-    ('verdanai.ttf', 'Verdana', (False, True)),
-    ('verdanaz.ttf', 'Verdana', (True, True)),
-    ('webdings.ttf', 'Webdings', (False, False)),
-    ('wingding.ttf', 'Wingdings', (False, False)),
-    ('simhei.ttf', 'SimHei', (False, False)),
-    ('simfang.ttf', 'FangSong_GB2312', (False, False)),
-    ('kaiu.ttf', 'DFKai-SB', (False, False)),
-    ('simkai.ttf', 'KaiTi_GB2312', (False, False)),
-    ('msgothic.ttc', 'MS Gothic', (False, False)),
-    ('msmincho.ttc', 'MS Mincho', (False, False)),
-    ('gulim.ttc', 'Gulim', (False, False)),
-    ('mingliu.ttc', 'Mingliu', (False, False)),
-    ('simsun.ttc', 'Simsun', (False, False)),
-    ('batang.ttc', 'Batang', (False, False)),
+    ('ahronbd.ttf', 'Aharoni', True, False),
+    ('andlso.ttf', 'Andalus', False, False),
+    ('angsa.ttf', 'Angsana New', False, False),
+    ('angsab.ttf', 'Angsana New', True, False),
+    ('angsai.ttf', 'Angsana New', False, True),
+    ('angsaz.ttf', 'Angsana New', True, True),
+    ('angsau.ttf', 'AngsanaUPC', False, False),
+    ('angsaub.ttf', 'AngsanaUPC', True, False),
+    ('angsaui.ttf', 'AngsanaUPC', False, True),
+    ('angsauz.ttf', 'AngsanaUPC', True, True),
+    ('artro.ttf', 'Arabic Transparent', False, False),
+    ('artrbdo.ttf', 'Arabic Transparent', True, False),
+    ('agatha.ttf', 'Agatha', False, False),
+    ('arial.ttf', 'Arial', False, False),
+    ('arialbd.ttf', 'Arial', True, False),
+    ('ariali.ttf', 'Arial', False, True),
+    ('arialbi.ttf', 'Arial', True, True),
+    ('ariblk.ttf', 'Arial Black', False, False),
+    ('browa.ttf', 'Browallia New', False, False),
+    ('browab.ttf', 'Browallia New', True, False),
+    ('browai.ttf', 'Browallia New', False, True),
+    ('browaz.ttf', 'Browallia New', True, True),
+    ('browau.ttf', 'BrowalliaUPC', False, False),
+    ('browaub.ttf', 'BrowalliaUPC', True, False),
+    ('browaui.ttf', 'BrowalliaUPC', False, True),
+    ('browauz.ttf', 'BrowalliaUPC', True, True),
+    ('comic.ttf', 'Comic Sans MS', False, False),
+    ('comicbd.ttf', 'Comic Sans MS', True, False),
+    ('cordia.ttf', 'Cordia New', False, False),
+    ('cordiab.ttf', 'Cordia New', True, False),
+    ('cordiai.ttf', 'Cordia New', False, True),
+    ('cordiaz.ttf', 'Cordia New', True, True),
+    ('cordiau.ttf', 'CordiaUPC', False, False),
+    ('cordiaub.ttf', 'CordiaUPC', True, False),
+    ('cordiaui.ttf', 'CordiaUPC', False, True),
+    ('cordiauz.ttf', 'CordiaUPC', True, True),
+    ('cour.ttf', 'Courier New', False, False),
+    ('courbd.ttf', 'Courier New', True, False),
+    ('couri.ttf', 'Courier New', False, True),
+    ('courbi.ttf', 'Courier New', True, True),
+    ('david.ttf', 'David', False, False),
+    ('davidbd.ttf', 'David', True, False),
+    ('davidtr.ttf', 'David Transparent', False, False),
+    ('upcdl.ttf', 'DilleniaUPC', False, False),
+    ('upcdb.ttf', 'DilleniaUPC', True, False),
+    ('upcdi.ttf', 'DilleniaUPC', False, True),
+    ('upcdbi.ttf', 'DilleniaUPC', True, True),
+    ('estre.ttf', 'Estrangelo Edessa', False, False),
+    ('upcel.ttf', 'EucrosialUPC', False, False),
+    ('upceb.ttf', 'EucrosialUPC', True, False),
+    ('upcei.ttf', 'EucrosialUPC', False, True),
+    ('upcebi.ttf', 'EucrosialUPC', True, True),
+    ('mriamfx.ttf', 'Fixed Miriam Transparent', False, False),
+    ('framd.ttf', 'Franklin Gothic Medium', False, False),
+    ('framdit.ttf', 'Franklin Gothic Medium', False, True),
+    ('frank.ttf', 'FrankRuehl', False, False),
+    ('upcfl.ttf', 'FreesialUPC', False, False),
+    ('upcfb.ttf', 'FreesialUPC', True, False),
+    ('upcfi.ttf', 'FreesialUPC', False, True),
+    ('upcfbi.ttf', 'FreesialUPC', True, True),
+    ('gautami.ttf', 'Gautami', False, False),
+    ('georgia.ttf', 'Georgia', False, False),
+    ('georgiab.ttf', 'Georgia', True, False),
+    ('georgiai.ttf', 'Georgia', False, True),
+    ('georgiaz.ttf', 'Georgia', True, True),
+    ('impact.ttf', 'Impact', False, False),
+    ('upcil.ttf', 'IrisUPC', False, False),
+    ('upcib.ttf', 'IrisUPC', True, False),
+    ('upcii.ttf', 'IrisUPC', False, True),
+    ('upcibi.ttf', 'IrisUPC', True, True),
+    ('upcjl.ttf', 'JasmineUPC', False, False),
+    ('upcjb.ttf', 'JasmineUPC', True, False),
+    ('upcji.ttf', 'JasmineUPC', False, True),
+    ('upcjbi.ttf', 'JasmineUPC', True, True),
+    ('upckl.ttf', 'KodchiangUPC', False, False),
+    ('upckb.ttf', 'KodchiangUPC', True, False),
+    ('upcki.ttf', 'KodchiangUPC', False, True),
+    ('upckbi.ttf', 'KodchiangUPC', True, True),
+    ('latha.ttf', 'Latha', False, False),
+    ('lvnm.ttf', 'Levenim MT', False, False),
+    ('lvnmbd.ttf', 'Levenim MT', True, False),
+    ('upcll.ttf', 'LilyUPC', False, False),
+    ('upclb.ttf', 'LilyUPC', True, False),
+    ('upcli.ttf', 'LilyUPC', False, True),
+    ('upclbi.ttf', 'LilyUPC', True, True),
+    ('lucon.ttf', 'Lucida Console', False, False),
+    ('l_10646.ttf', 'Lucida Sans Unicode', False, False),
+    ('mangal.ttf', 'Mangal', False, False),
+    ('marlett.ttf', 'Marlett', False, False),
+    ('micross.ttf', 'Microsoft Sans Serif', False, False),
+    ('mriam.ttf', 'Miriam', False, False),
+    ('mriamc.ttf', 'Miriam Fixed', False, False),
+    ('mriamtr.ttf', 'Miriam Transparent', False, False),
+    ('mvboli.ttf', 'MV Boli', False, False),
+    ('nrkis.ttf', 'Narkisim', False, False),
+    ('pala.ttf', 'Falatino Linotype', False, False),
+    ('palab.ttf', 'Falatino Linotype', True, False),
+    ('palai.ttf', 'Falatino Linotype', False, True),
+    ('palabi.ttf', 'Falatino Linotype', True, True),
+    ('raavi.ttf', 'Raavi', False, False),
+    ('rod.ttf', 'Rod', False, False),
+    ('rodtr.ttf', 'Rod Transparent', False, False),
+    ('shruti.ttf', 'Shruti', False, False),
+    ('simpo.ttf', 'Simplified Arabic', False, False),
+    ('simpbdo.ttf', 'Simplified Arabic', True, False),
+    ('simpfxo.ttf', 'Simplified Arabic Fixed', False, False),
+    ('sylfaen.ttf', 'Sylfaen', False, False),
+    ('symbol.ttf', 'Symbol', False, False),
+    ('tahoma.ttf', 'Tahoma', False, False),
+    ('tahomabd.ttf', 'Tahoma', True, False),
+    ('times.ttf', 'Times New Roman', False, False),
+    ('timesbd.ttf', 'Times New Roman', True, False),
+    ('timesi.ttf', 'Times New Roman', False, True),
+    ('timesbi.ttf', 'Times New Roman', True, True),
+    ('trado.ttf', 'Traditional Arabic', False, False),
+    ('tradbdo.ttf', 'Traditional Arabic', True, False),
+    ('Trebuc.ttf', 'Trebuchet MS', False, False),
+    ('Trebucbd.ttf', 'Trebuchet MS', True, False),
+    ('Trebucit.ttf', 'Trebuchet MS', False, True),
+    ('Trebucbi.ttf', 'Trebuchet MS', True, True),
+    ('tunga.ttf', 'Tunga', False, False),
+    ('verdana.ttf', 'Verdana', False, False),
+    ('verdanab.ttf', 'Verdana', True, False),
+    ('verdanai.ttf', 'Verdana', False, True),
+    ('verdanaz.ttf', 'Verdana', True, True),
+    ('webdings.ttf', 'Webdings', False, False),
+    ('wingding.ttf', 'Wingdings', False, False),
+    ('simhei.ttf', 'SimHei', False, False),
+    ('simfang.ttf', 'FangSong_GB2312', False, False),
+    ('kaiu.ttf', 'DFKai-SB', False, False),
+    ('simkai.ttf', 'KaiTi_GB2312', False, False),
+    ('msgothic.ttc', 'MS Gothic', False, False),
+    ('msmincho.ttc', 'MS Mincho', False, False),
+    ('gulim.ttc', 'Gulim', False, False),
+    ('mingliu.ttc', 'Mingliu', False, False),
+    ('simsun.ttc', 'Simsun', False, False),
+    ('batang.ttc', 'Batang', False, False),
     ]
 
 def initsysfonts_win32():
     #add recognized fonts from the fonts directory because the default
     #fonts may not be entered in the registry.
     win_font_files_mapping = dict(
-        [(font.lower(), (_simplename(name), face))
-         for font, name, face in XP_default_font_files])
+        [(file_name.lower(), (_simplename(name), bold, italic))
+         for file_name, name, bold, italic in XP_default_font_files])
 
     font_dir_path = os.path.join(windir, 'fonts')
     try:
         for font in font_file_paths:
             file_name = os.path.basename(font)
             try:
-                name, face = win_font_file_mapping[file_name]
+                name, bold, italic = win_font_file_mapping[file_name]
             except KeyError:
                 pass
             else:
-                try:
-                    faces = fonts[name]
-                except KeyError:
-                    _addfont(name, face[0], face[1], font, fonts)
-                else:
-                    if face not in faces:
-                        _addfont(name, face[0], face[1], font, fonts)
+                _addfont(name, bold, italic, font, fonts)
 
     #add additional fonts entered in the registry.
 
     if (PyModule_AddObject (module, "Color", (PyObject *) &PyColor_Type)) {
         Py_DECREF (&PyColor_Type);
         Py_DECREF (_COLORDICT);
+        DECREF_MOD(module);
         MODINIT_ERROR;
     }
     Py_INCREF (_COLORDICT);
     if (PyModule_AddObject (module, "THECOLORS", _COLORDICT)) {
         Py_DECREF (_COLORDICT);
         Py_DECREF (_COLORDICT);
+        DECREF_MOD(module);
         MODINIT_ERROR;
     }
     dict = PyModule_GetDict (module);
     apiobj = PyCObject_FromVoidPtr (c_api, NULL);
     if (apiobj == NULL) {
         Py_DECREF (_COLORDICT);
+        DECREF_MOD(module);
         MODINIT_ERROR;
     }
     if (PyDict_SetItemString (dict, PYGAMEAPI_LOCAL_ENTRY, apiobj)) {
         Py_DECREF (_COLORDICT);
+        DECREF_MOD(module);
         MODINIT_ERROR;
     }
     Py_DECREF (apiobj);
                 ecode = PyDict_SetItemString (dict, NAMES[i], ref);
                 Py_DECREF (ref);
                 if (ecode == -1) {
+                    DECREF_MOD(module);
                     MODINIT_ERROR;
                 }
             }
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;;
+        MODINIT_ERROR;
     }
     import_pygame_surface ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;;
+        MODINIT_ERROR;
     }
     import_pygame_rwobject ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;;
+        MODINIT_ERROR;
     }
 
     /* create the module */
     }
     import_pygame_surface ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_rwobject ();
 
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     /* type preparation */
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     /* create the module */
     dict = PyModule_GetDict(module);
     if (PyDict_SetItemString (dict, "MaskType",
                               (PyObject *)&PyMask_Type) == -1) {
+        DECREF_MOD(module);
         MODINIT_ERROR;
     }
     /* export the c api */
     /*imported needed apis*/
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_rwobject ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_bufferproxy ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     /* type preparation */
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_rect ();    
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     if (PyType_Ready (&PyOverlay_Type) == -1) {
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_color();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_surface ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     /* type preparation */
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	return;
+        return;
     }
 
     /* create the module */
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     /* type preparation */
     */
     import_pygame_base ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_color ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_rect ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
     import_pygame_surface ();
     if (PyErr_Occurred ()) {
-	MODINIT_ERROR;
+        MODINIT_ERROR;
     }
 
     /* create the module */

test/sndarray_test.py

             self.fail("no array package installed")
 
         def check_array(size, channels, test_data):
-            pygame.mixer.init(22050, size, channels)
             try:
+                pygame.mixer.init(22050, size, channels)
+            except pygame.error:
                 # Not all sizes are supported on all systems.
+                return
+            try:
                 __, sz, __ = pygame.mixer.get_init()
                 if sz == size:
                     srcarr = array(test_data, self.array_dtypes[size])
             self.fail("no array package installed")
 
         def check_sound(size, channels, test_data):
-            pygame.mixer.init(22050, size, channels)
             try:
+                pygame.mixer.init(22050, size, channels)
+            except pygame.error:
                 # Not all sizes are supported on all systems.
+                return
+            try:
                 __, sz, __ = pygame.mixer.get_init()
                 if sz == size:
                     srcarr = array(test_data, self.array_dtypes[size])
             self.fail("no array package installed")
 
         def check_sample(size, channels, test_data):
-            pygame.mixer.init(22050, size, channels)
             try:
+                pygame.mixer.init(22050, size, channels)
+            except pygame.error:
                 # Not all sizes are supported on all systems.
+                return
+            try:
                 __, sz, __ = pygame.mixer.get_init()
                 if sz == size:
                     zeroed = '\0' * ((abs(size) // 8) *
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.