Commit 7cd06bea authored by Lisandro Dalcin's avatar Lisandro Dalcin Committed by GitHub

Merge pull request #1938 from cython/dalcinl/fix-module-cleanup

PyPy3: Register module cleanup with atexit
parents 99da4323 30256a7e
...@@ -1040,7 +1040,7 @@ static int __Pyx_RegisterCleanup(void); /*proto*/ ...@@ -1040,7 +1040,7 @@ static int __Pyx_RegisterCleanup(void); /*proto*/
//@substitute: naming //@substitute: naming
//@requires: ImportExport.c::ModuleImport //@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) { static PyObject* ${cleanup_cname}_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
${cleanup_cname}(module); ${cleanup_cname}(module);
Py_INCREF(Py_None); return Py_None; Py_INCREF(Py_None); return Py_None;
...@@ -1113,7 +1113,7 @@ bad: ...@@ -1113,7 +1113,7 @@ bad:
#else #else
// fake call purely to work around "unused function" warning for __Pyx_ImportModule() // fake call purely to work around "unused function" warning for __Pyx_ImportModule()
static int __Pyx_RegisterCleanup(void) { static int __Pyx_RegisterCleanup(void) {
if ((0)) __Pyx_ImportModule(NULL); (void)__Pyx_ImportModule; /* unused */
return 0; return 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment