Skip to content

Commit 61f4db8

Browse files
authored
bpo-38644: Pass tstate in ceval.c (GH-18222)
Pass explicitly the Python thread state (tstate) in ceval.c.
1 parent 01bf219 commit 61f4db8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎Python/ceval.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
21382138
PyObject *val = POP();
21392139
PyObject *tb = POP();
21402140
assert(PyExceptionClass_Check(exc));
2141-
PyErr_Restore(exc, val, tb);
2141+
_PyErr_Restore(tstate, exc, val, tb);
21422142
goto exception_unwind;
21432143
}
21442144

@@ -2640,7 +2640,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
26402640
if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) &&
26412641
(iterable->ob_type->tp_iter == NULL && !PySequence_Check(iterable)))
26422642
{
2643-
PyErr_Clear();
2643+
_PyErr_Clear(tstate);
26442644
_PyErr_Format(tstate, PyExc_TypeError,
26452645
"Value after * must be an iterable, not %.200s",
26462646
Py_TYPE(iterable)->tp_name);
@@ -4340,7 +4340,7 @@ do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause)
43404340
}
43414341

43424342
_PyErr_SetObject(tstate, type, value);
4343-
/* PyErr_SetObject incref's its arguments */
4343+
/* _PyErr_SetObject incref's its arguments */
43444344
Py_DECREF(value);
43454345
Py_DECREF(type);
43464346
return 0;
@@ -5208,7 +5208,7 @@ check_args_iterable(PyThreadState *tstate, PyObject *func, PyObject *args)
52085208
/* check_args_iterable() may be called with a live exception:
52095209
* clear it to prevent calling _PyObject_FunctionStr() with an
52105210
* exception set. */
5211-
PyErr_Clear();
5211+
_PyErr_Clear(tstate);
52125212
PyObject *funcstr = _PyObject_FunctionStr(func);
52135213
if (funcstr != NULL) {
52145214
_PyErr_Format(tstate, PyExc_TypeError,
@@ -5231,7 +5231,7 @@ format_kwargs_error(PyThreadState *tstate, PyObject *func, PyObject *kwargs)
52315231
* is not a mapping.
52325232
*/
52335233
if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) {
5234-
PyErr_Clear();
5234+
_PyErr_Clear(tstate);
52355235
PyObject *funcstr = _PyObject_FunctionStr(func);
52365236
if (funcstr != NULL) {
52375237
_PyErr_Format(
@@ -5245,7 +5245,7 @@ format_kwargs_error(PyThreadState *tstate, PyObject *func, PyObject *kwargs)
52455245
PyObject *exc, *val, *tb;
52465246
_PyErr_Fetch(tstate, &exc, &val, &tb);
52475247
if (val && PyTuple_Check(val) && PyTuple_GET_SIZE(val) == 1) {
5248-
PyErr_Clear();
5248+
_PyErr_Clear(tstate);
52495249
PyObject *funcstr = _PyObject_FunctionStr(func);
52505250
if (funcstr != NULL) {
52515251
PyObject *key = PyTuple_GET_ITEM(val, 0);

0 commit comments

Comments
 (0)