summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisandro Dalcin <dalcinl@gmail.com>2017-10-15 23:14:02 +0300
committerLisandro Dalcin <dalcinl@gmail.com>2017-10-18 17:45:48 +0300
commit30256a7e8908acb90ecc912e57361c49f1a80e4a (patch)
tree5e51c7ddd3022e3fbde9743f98674113843b3871
parent99da4323411cf7a0d83d1dd319c63a65845f8ff7 (diff)
downloadcython-dalcinl/fix-module-cleanup.tar.gz
PyPy3: Register module cleanup with atexit (PyModuleDef.m_free is not used)dalcinl/fix-module-cleanup
-rw-r--r--Cython/Utility/ModuleSetupCode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 043cd7206..910d3e942 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -1040,7 +1040,7 @@ static int __Pyx_RegisterCleanup(void); /*proto*/
//@substitute: naming
//@requires: ImportExport.c::ModuleImport
-#if PY_MAJOR_VERSION < 3
+#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
static PyObject* ${cleanup_cname}_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
${cleanup_cname}(module);
Py_INCREF(Py_None); return Py_None;
@@ -1113,7 +1113,7 @@ bad:
#else
// fake call purely to work around "unused function" warning for __Pyx_ImportModule()
static int __Pyx_RegisterCleanup(void) {
- if ((0)) __Pyx_ImportModule(NULL);
+ (void)__Pyx_ImportModule; /* unused */
return 0;
}
#endif