[Scipy-svn] r6711 - in trunk: scipy/spatial/src tools

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


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

Modified:
   trunk/scipy/spatial/src/distance_wrap.c
   trunk/tools/py3tool.py
Log:
3K: scipy.spatial builds and most tests pass.

Modified: trunk/scipy/spatial/src/distance_wrap.c
===================================================================
--- trunk/scipy/spatial/src/distance_wrap.c	2010-09-12 00:47:31 UTC (rev 6710)
+++ trunk/scipy/spatial/src/distance_wrap.c	2010-09-12 00:47:47 UTC (rev 6711)
@@ -1132,7 +1132,32 @@
   {NULL, NULL}     /* Sentinel - marks the end of this structure */
 };
 
-PyMODINIT_FUNC init_distance_wrap(void)  {
+#if PY_VERSION_HEX >= 0x03000000
+static struct PyModuleDef moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "_distance_wrap",
+    NULL,
+    -1,
+    _distanceWrapMethods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyObject *PyInit__distance_wrap(void)
+{
+    PyObject *m;
+
+    m = PyModule_Create(&moduledef);
+    import_array();
+
+    return m;
+}
+#else
+PyMODINIT_FUNC init_distance_wrap(void)
+{
   (void) Py_InitModule("_distance_wrap", _distanceWrapMethods);
   import_array();  // Must be present for NumPy.  Called first after above line.
 }
+#endif

Modified: trunk/tools/py3tool.py
===================================================================
--- trunk/tools/py3tool.py	2010-09-12 00:47:31 UTC (rev 6710)
+++ trunk/tools/py3tool.py	2010-09-12 00:47:47 UTC (rev 6711)
@@ -149,6 +149,8 @@
         os.path.join('special', '__init__.py'),
         os.path.join('special', 'basic.py'),
         os.path.join('special', 'orthogonal.py'),
+        os.path.join('spatial', '__init__.py'),
+        os.path.join('spatial', 'distance.py'),
     ]
 
     if any(filename.endswith(x) for x in import_mangling):
@@ -158,7 +160,7 @@
         for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve',
                     '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack',
                     'calc_lwork', '_cephes', 'specfun', 'orthogonal_eval',
-                    'lambertw']:
+                    'lambertw', 'ckdtree', '_distance_wrap']:
             text = re.sub(r'^(\s*)import %s' % mod,
                           r'\1from . import %s' % mod,
                           text, flags=re.M)



More information about the Scipy-svn mailing list