diff options
author | Victor Stinner <vstinner@python.org> | 2019-11-14 12:36:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 12:36:21 (GMT) |
commit | 4d231bcc77ac8ce7d11bda0804130dcdd678f710 (patch) | |
tree | 5cb1019d966e2e29977430b0824d11ccf8bd24e4 /Python/_warnings.c | |
parent | b9e681261cd5ce6db0a79461c58d7cc52cfa4902 (diff) | |
download | cpython-4d231bcc77ac8ce7d11bda0804130dcdd678f710.zip cpython-4d231bcc77ac8ce7d11bda0804130dcdd678f710.tar.gz cpython-4d231bcc77ac8ce7d11bda0804130dcdd678f710.tar.bz2 |
bpo-38644: Add _PyObject_Call() (GH-17089)
* Add pycore_call.h internal header file.
* Add _PyObject_Call(): PyObject_Call() with tstate
* Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate
* Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict()
with tstate
* _PyObject_Call_Prepend() now takes tstate
* Replace _PyObject_FastCall() calls
with _PyObject_VectorcallTstate() calls
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r-- | Python/_warnings.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index dd2b072..b8585d2 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_pyerrors.h" #include "pycore_pystate.h" #include "frameobject.h" #include "clinic/_warnings.c.h" @@ -27,10 +28,11 @@ static struct PyModuleDef warningsmodule; static WarningsState * _Warnings_GetState() { - PyThreadState *tstate = PyThreadState_GET(); + PyThreadState *tstate = _PyThreadState_GET(); if (tstate == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "_Warnings_GetState: could not identify current interpreter"); + _PyErr_SetString(tstate, PyExc_RuntimeError, + "_Warnings_GetState: could not identify " + "current interpreter"); return NULL; } return &tstate->interp->warnings; |