Files
macports-ports/python/py-clawpack/files/patch-python3.diff
T
Marcus Calhoun-Lopez 7891d36c57 py-clawpack: fix build on newer systems
Do not use initialization function that was removed in Python 3.
This prevents builds on newer systems.
Increase revision since change might affect all systems.

See https://github.com/clawpack/pyclaw/pull/667
See https://github.com/clawpack/pyclaw/issues/653
2021-04-15 08:22:58 -07:00

27 lines
848 B
Diff

See https://github.com/clawpack/pyclaw/pull/667
--- pyclaw/src/pyclaw/limiters/weno/reconstruct.c.orig 2020-04-27 00:20:31.000000000 -0700
+++ pyclaw/src/pyclaw/limiters/weno/reconstruct.c 2021-04-15 07:06:02.000000000 -0700
@@ -5263,6 +5263,21 @@
PyMODINIT_FUNC
initreconstruct (void)
{
+#if PY_MAJOR_VERSION >= 3
+ static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "reconstruct", /* m_name */
+ NULL, /* m_doc */
+ -1, /* m_size */
+ reconstructmethods, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+ };
+ PyModule_Create(&moduledef);
+#else
(void) Py_InitModule ("reconstruct", reconstructmethods);
+#endif
import_array ();
}