Skip to content

Commit 6eaecce

Browse files
committed
Update Python inlined files: 3.12.7 (3.0.1)
1 parent 0285692 commit 6eaecce

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

graalpython/com.oracle.graal.python.cext/include/internal/pycore_ceval.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ extern void _PyEval_DeactivateOpCache(void);
111111
/* With USE_STACKCHECK macro defined, trigger stack checks in
112112
_Py_CheckRecursiveCall() on every 64th call to _Py_EnterRecursiveCall. */
113113
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
114-
return (tstate->recursion_remaining-- <= 0
115-
|| (tstate->recursion_remaining & 63) == 0);
114+
return (tstate->c_recursion_remaining-- <= 0
115+
|| (tstate->c_recursion_remaining & 63) == 0);
116116
}
117117
#else
118118
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
119-
return tstate->recursion_remaining-- <= 0;
119+
return tstate->c_recursion_remaining-- <= 0;
120120
}
121121
#endif
122122

@@ -138,7 +138,7 @@ static inline int _Py_EnterRecursiveCall(const char *where) {
138138
}
139139

140140
static inline void _Py_LeaveRecursiveCallTstate(PyThreadState *tstate) {
141-
tstate->recursion_remaining++;
141+
tstate->c_recursion_remaining++;
142142
}
143143

144144
static inline void _Py_LeaveRecursiveCall(void) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,10 +2370,10 @@ _Py_Dealloc(PyObject *op)
23702370
destructor dealloc = type->tp_dealloc;
23712371
#ifdef Py_DEBUG
23722372
PyThreadState *tstate = _PyThreadState_GET();
2373-
PyObject *old_exc_type = tstate->curexc_type;
2373+
PyObject *old_exc = tstate != NULL ? tstate->current_exception : NULL;
23742374
// Keep the old exception type alive to prevent undefined behavior
23752375
// on (tstate->curexc_type != old_exc_type) below
2376-
Py_XINCREF(old_exc_type);
2376+
Py_XINCREF(old_exc);
23772377
// Make sure that type->tp_name remains valid
23782378
Py_INCREF(type);
23792379
#endif
@@ -2386,12 +2386,12 @@ _Py_Dealloc(PyObject *op)
23862386
#ifdef Py_DEBUG
23872387
// gh-89373: The tp_dealloc function must leave the current exception
23882388
// unchanged.
2389-
if (tstate->curexc_type != old_exc_type) {
2389+
if (tstate != NULL && tstate->current_exception != old_exc) {
23902390
const char *err;
2391-
if (old_exc_type == NULL) {
2391+
if (old_exc == NULL) {
23922392
err = "Deallocator of type '%s' raised an exception";
23932393
}
2394-
else if (tstate->curexc_type == NULL) {
2394+
else if (tstate->current_exception == NULL) {
23952395
err = "Deallocator of type '%s' cleared the current exception";
23962396
}
23972397
else {

0 commit comments

Comments
 (0)