Skip to content

Commit 0aa1a4d

Browse files
committed
Implement _Py_IsFinalizing
1 parent 2c44644 commit 0aa1a4d

File tree

2 files changed

+7
-1
lines changed
  • graalpython

2 files changed

+7
-1
lines changed

graalpython/com.oracle.graal.python.cext/src/pylifecycle.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ int Py_IsInitialized(void) {
4444
return !graalpy_finalizing;
4545
}
4646

47+
int
48+
_Py_IsFinalizing(void)
49+
{
50+
return graalpy_finalizing;
51+
}
52+
4753
void _Py_NO_RETURN _Py_FatalErrorFunc(const char *func, const char *msg) {
4854
GraalPyTruffle_FatalErrorFunc(func, msg, -1);
4955
/* If the above upcall returns, then we just fall through to the 'abort' call. */

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CApiFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ public final class CApiFunction {
618618
@CApiBuiltin(name = "_Py_HashPointer", ret = Py_hash_t, args = {CONST_VOID_PTR}, call = CImpl)
619619
@CApiBuiltin(name = "_Py_HashPointerRaw", ret = Py_hash_t, args = {CONST_VOID_PTR}, call = CImpl)
620620
@CApiBuiltin(name = "_Py_IncRef", ret = Void, args = {PyObject}, call = CImpl)
621+
@CApiBuiltin(name = "_Py_IsFinalizing", ret = Int, args = {}, call = CImpl)
621622
@CApiBuiltin(name = "_Py_NewReference", ret = Void, args = {PyObject}, call = CImpl)
622623
@CApiBuiltin(name = "_Py_VaBuildStack", ret = PyObjectPtr, args = {PyObjectPtr, Py_ssize_t, ConstCharPtrAsTruffleString, VA_LIST, PY_SSIZE_T_PTR}, call = CImpl)
623624
@CApiBuiltin(name = "_Py_VaBuildStack_SizeT", ret = PyObjectPtr, args = {PyObjectPtr, Py_ssize_t, ConstCharPtrAsTruffleString, VA_LIST, PY_SSIZE_T_PTR}, call = CImpl)
@@ -1215,7 +1216,6 @@ public final class CApiFunction {
12151216
@CApiBuiltin(name = "_Py_GetConfig", ret = CONST_PYCONFIG_PTR, args = {}, call = NotImplemented)
12161217
@CApiBuiltin(name = "_Py_InitializeMain", ret = PYSTATUS, args = {}, call = NotImplemented)
12171218
@CApiBuiltin(name = "_Py_IsCoreInitialized", ret = Int, args = {}, call = NotImplemented)
1218-
@CApiBuiltin(name = "_Py_IsFinalizing", ret = Int, args = {}, call = NotImplemented)
12191219
@CApiBuiltin(name = "_Py_LegacyLocaleDetected", ret = Int, args = {Int}, call = NotImplemented)
12201220
@CApiBuiltin(name = "_Py_NewInterpreter", ret = PyThreadState, args = {Int}, call = NotImplemented)
12211221
@CApiBuiltin(name = "_Py_RestoreSignals", ret = Void, args = {}, call = NotImplemented)

0 commit comments

Comments
 (0)