@@ -198,8 +198,8 @@ static int
198
198
_PyContext_Enter (PyThreadState * ts , PyContext * ctx )
199
199
{
200
200
if (ctx -> ctx_entered ) {
201
- _PyErr_Format ( ts , PyExc_RuntimeError ,
202
- "cannot enter context: %R is already entered" , ctx );
201
+ PyErr_Format ( PyExc_RuntimeError ,
202
+ "cannot enter context: %R is already entered" , ctx );
203
203
return -1 ;
204
204
}
205
205
@@ -702,25 +702,23 @@ _contextvars_Context_copy_impl(PyContext *self)
702
702
703
703
704
704
static PyObject *
705
- context_run (PyContext * self , PyObject * const * args ,
705
+ context_run (PyObject * self , PyObject * const * args ,
706
706
Py_ssize_t nargs , PyObject * kwnames )
707
707
{
708
- PyThreadState * ts = _PyThreadState_GET ();
709
-
710
708
if (nargs < 1 ) {
711
- _PyErr_SetString ( ts , PyExc_TypeError ,
712
- "run() missing 1 required positional argument" );
709
+ PyErr_SetString ( PyExc_TypeError ,
710
+ "run() missing 1 required positional argument" );
713
711
return NULL ;
714
712
}
715
713
716
- if (_PyContext_Enter ( ts , self )) {
714
+ if (PyContext_Enter ( self )) {
717
715
return NULL ;
718
716
}
719
717
720
- PyObject * call_result = _PyObject_VectorcallTstate (
721
- ts , args [0 ], args + 1 , nargs - 1 , kwnames );
718
+ PyObject * call_result =
719
+ PyObject_Vectorcall ( args [0 ], args + 1 , nargs - 1 , kwnames );
722
720
723
- if (_PyContext_Exit ( ts , self )) {
721
+ if (PyContext_Exit ( self )) {
724
722
Py_XDECREF (call_result );
725
723
return NULL ;
726
724
}
0 commit comments