Commit 5cdd8e2d authored by Stefan Behnel's avatar Stefan Behnel

Use more recent C-API functions on tear-down of the embedding code.

parent 3ad4c989
...@@ -58,7 +58,12 @@ static int __Pyx_main(int argc, wchar_t **argv) { ...@@ -58,7 +58,12 @@ static int __Pyx_main(int argc, wchar_t **argv) {
} }
Py_XDECREF(m); Py_XDECREF(m);
} }
#if PY_VERSION_HEX < 0x03060000
Py_Finalize(); Py_Finalize();
#else
if (Py_FinalizeEx() < 0)
return 2;
#endif
return 0; return 0;
} }
...@@ -200,7 +205,11 @@ int ...@@ -200,7 +205,11 @@ int
if (res == 0) if (res == 0)
res = __Pyx_main(argc, argv_copy); res = __Pyx_main(argc, argv_copy);
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
#if PY_VERSION_HEX < 0x03050000
free(argv_copy2[i]); free(argv_copy2[i]);
#else
PyMem_RawFree(argv_copy2[i]);
#endif
} }
free(argv_copy); free(argv_copy);
free(argv_copy2); free(argv_copy2);
......
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