[Scipy-svn] r6737 - trunk/scipy/linalg

scipy-svn@scip... scipy-svn@scip...
Sat Sep 11 19:54:54 CDT 2010


Author: ptvirtan
Date: 2010-09-11 19:54:54 -0500 (Sat, 11 Sep 2010)
New Revision: 6737

Modified:
   trunk/scipy/linalg/atlas_version.c
Log:
3K: linalg: convert atlas_version.c module init to Py3

Modified: trunk/scipy/linalg/atlas_version.c
===================================================================
--- trunk/scipy/linalg/atlas_version.c	2010-09-12 00:54:35 UTC (rev 6736)
+++ trunk/scipy/linalg/atlas_version.c	2010-09-12 00:54:54 UTC (rev 6737)
@@ -20,14 +20,40 @@
     {NULL, NULL, 0, NULL}
 };
 
+#if PY_VERSION_HEX >= 0x03000000
+
+static struct PyModuleDef moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "atlas_version",
+    NULL,
+    -1,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyObject *PyInit_atlas_version(void)
+{
+#define RETVAL m
+    PyObject *m;
+    m = PyModule_Create(&moduledef);
+#else
+#define RETVAL
 PyMODINIT_FUNC initatlas_version(void)
 {
     PyObject *m = NULL;
     m = Py_InitModule("atlas_version", module_methods);
+#endif
+    if (m == NULL) {
+        return RETVAL;
+    }
 #if defined(ATLAS_INFO)
     {
         PyObject *d = PyModule_GetDict(m);
         PyDict_SetItemString(d,"ATLAS_VERSION",PyString_FromString(ATLAS_INFO));
     }
 #endif
+    return RETVAL;
 }



More information about the Scipy-svn mailing list