mirror of
https://github.com/python/cpython.git
synced 2025-09-10 02:36:56 +00:00
Changed random calls to PyThreadState_Get() to use the macro
This commit is contained in:
parent
c69ebe8d50
commit
e5662aedef
8 changed files with 26 additions and 26 deletions
|
@ -48,7 +48,7 @@ extern const char *PyWin_DLLVersionString;
|
|||
PyObject *
|
||||
PySys_GetObject(char *name)
|
||||
{
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
PyObject *sd = tstate->interp->sysdict;
|
||||
if (sd == NULL)
|
||||
return NULL;
|
||||
|
@ -70,7 +70,7 @@ PySys_GetFile(char *name, FILE *def)
|
|||
int
|
||||
PySys_SetObject(char *name, PyObject *v)
|
||||
{
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
PyObject *sd = tstate->interp->sysdict;
|
||||
if (v == NULL) {
|
||||
if (PyDict_GetItemString(sd, name) == NULL)
|
||||
|
@ -86,7 +86,7 @@ static PyObject *
|
|||
sys_displayhook(PyObject *self, PyObject *o)
|
||||
{
|
||||
PyObject *outf;
|
||||
PyInterpreterState *interp = PyThreadState_Get()->interp;
|
||||
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
||||
PyObject *modules = interp->modules;
|
||||
PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
|
||||
|
||||
|
@ -149,7 +149,7 @@ static PyObject *
|
|||
sys_exc_info(PyObject *self, PyObject *noargs)
|
||||
{
|
||||
PyThreadState *tstate;
|
||||
tstate = PyThreadState_Get();
|
||||
tstate = PyThreadState_GET();
|
||||
return Py_BuildValue(
|
||||
"(OOO)",
|
||||
tstate->exc_type != NULL ? tstate->exc_type : Py_None,
|
||||
|
@ -168,7 +168,7 @@ clause in the current stack frame or in an older stack frame."
|
|||
static PyObject *
|
||||
sys_exc_clear(PyObject *self, PyObject *noargs)
|
||||
{
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
||||
tmp_type = tstate->exc_type;
|
||||
tmp_value = tstate->exc_value;
|
||||
|
@ -514,7 +514,7 @@ static PyObject *
|
|||
sys_setdlopenflags(PyObject *self, PyObject *args)
|
||||
{
|
||||
int new_val;
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
if (!PyArg_ParseTuple(args, "i:setdlopenflags", &new_val))
|
||||
return NULL;
|
||||
if (!tstate)
|
||||
|
@ -537,7 +537,7 @@ sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)"
|
|||
static PyObject *
|
||||
sys_getdlopenflags(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
if (!tstate)
|
||||
return NULL;
|
||||
return PyInt_FromLong(tstate->interp->dlopenflags);
|
||||
|
@ -615,7 +615,7 @@ purposes only."
|
|||
static PyObject *
|
||||
sys_getframe(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyFrameObject *f = PyThreadState_Get()->frame;
|
||||
PyFrameObject *f = PyThreadState_GET()->frame;
|
||||
int depth = -1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:_getframe", &depth))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue