Commits

Anonymous committed 8f117d2

Making it so the numeric based surfarray doesn't stick around without numeric

Comments (0)

Files changed (1)

src/_numericsurfarray.c

 void init_numericsurfarray (void)
 {
     PyObject *module;
+    PyObject* numeric_module;
     
-    /* create the module */
-    module = Py_InitModule3 ("_numericsurfarray", surfarray_builtins,
-                             DOC_PYGAMESURFARRAY);
-    
-    /*imported needed apis*/
-    import_pygame_base ();
-    import_pygame_surface ();
-    import_array ();
-    /*needed for Numeric in python2.3*/
-    PyImport_ImportModule ("Numeric");
+    numeric_module = PyImport_ImportModule ("Numeric");
+    if (numeric_module != 0)
+    {
+        /* create the module */
+        module = Py_InitModule3 ("_numericsurfarray", surfarray_builtins,
+                                 DOC_PYGAMESURFARRAY);
+	    
+        import_pygame_base ();
+        import_pygame_surface ();
+        import_array ();
+    }
 }