diff Python/sysmodule.c @ 31797:846b3ee7e106 legacy-trunk

Changed random calls to PyThreadState_Get() to use the macro
author Nicholas Bastin <nick.bastin@gmail.com>
date Wed, 24 Mar 2004 22:22:12 +0000
parents 1c117dbb2def
children 41c59d80bbc5
line wrap: on
line diff
--- a/Python/sysmodule.c	Wed Mar 24 21:57:10 2004 +0000
+++ b/Python/sysmodule.c	Wed Mar 24 22:22:12 2004 +0000
@@ -48,7 +48,7 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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 @@
 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))