[Scipy-svn] r6714 - trunk/scipy/optimize/tnc

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


Author: ptvirtan
Date: 2010-09-11 19:48:31 -0500 (Sat, 11 Sep 2010)
New Revision: 6714

Modified:
   trunk/scipy/optimize/tnc/moduleTNC.c
Log:
3K: moduleTNC converted to support py3.

Modified: trunk/scipy/optimize/tnc/moduleTNC.c
===================================================================
--- trunk/scipy/optimize/tnc/moduleTNC.c	2010-09-12 00:48:16 UTC (rev 6713)
+++ trunk/scipy/optimize/tnc/moduleTNC.c	2010-09-12 00:48:31 UTC (rev 6714)
@@ -304,7 +304,26 @@
   {NULL, NULL}
 };
 
+#if PY_VERSION_HEX >= 0x03000000
+static struct PyModuleDef moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "moduleTNC",
+    NULL,
+    -1,
+    moduleTNC_methods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyObject *PyInit_moduleTNC(void)
+{
+    return PyModule_Create(&moduledef);
+}
+#else
 PyMODINIT_FUNC initmoduleTNC(void)
 {
   (void) Py_InitModule("moduleTNC", moduleTNC_methods);
 }
+#endif



More information about the Scipy-svn mailing list