[Python-checkins] python/dist/src/Python ceval.c, 2.387, 2.388 codecs.c, 2.22, 2.23 errors.c, 2.81, 2.82 import.c, 2.227, 2.228 pystate.c, 2.29, 2.30 pythonrun.c, 2.204, 2.205 sysmodule.c, 2.122, 2.123

mondragon at users.sourceforge.net mondragon at users.sourceforge.net
Wed Mar 24 17:22:22 EST 2004


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14535/Python

Modified Files:
	ceval.c codecs.c errors.c import.c pystate.c pythonrun.c 
	sysmodule.c 
Log Message:
Changed random calls to PyThreadState_Get() to use the macro


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.387
retrieving revision 2.388
diff -C2 -d -r2.387 -r2.388
*** ceval.c	24 Mar 2004 21:57:09 -0000	2.387
--- ceval.c	24 Mar 2004 22:22:11 -0000	2.388
***************
*** 2844,2848 ****
  	if (type == NULL) {
  		/* Reraise */
! 		PyThreadState *tstate = PyThreadState_Get();
  		type = tstate->exc_type == NULL ? Py_None : tstate->exc_type;
  		value = tstate->exc_value;
--- 2844,2848 ----
  	if (type == NULL) {
  		/* Reraise */
! 		PyThreadState *tstate = PyThreadState_GET();
  		type = tstate->exc_type == NULL ? Py_None : tstate->exc_type;
  		value = tstate->exc_value;
***************
*** 3222,3226 ****
  PyEval_SetProfile(Py_tracefunc func, PyObject *arg)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  	PyObject *temp = tstate->c_profileobj;
  	Py_XINCREF(arg);
--- 3222,3226 ----
  PyEval_SetProfile(Py_tracefunc func, PyObject *arg)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  	PyObject *temp = tstate->c_profileobj;
  	Py_XINCREF(arg);
***************
*** 3237,3241 ****
  PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  	PyObject *temp = tstate->c_traceobj;
  	Py_XINCREF(arg);
--- 3237,3241 ----
  PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  	PyObject *temp = tstate->c_traceobj;
  	Py_XINCREF(arg);
***************
*** 3255,3259 ****
  	PyFrameObject *current_frame = PyEval_GetFrame();
  	if (current_frame == NULL)
! 		return PyThreadState_Get()->interp->builtins;
  	else
  		return current_frame->f_builtins;
--- 3255,3259 ----
  	PyFrameObject *current_frame = PyEval_GetFrame();
  	if (current_frame == NULL)
! 		return PyThreadState_GET()->interp->builtins;
  	else
  		return current_frame->f_builtins;
***************
*** 3283,3287 ****
  PyEval_GetFrame(void)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  	return _PyThreadState_GetFrame(tstate);
  }
--- 3283,3287 ----
  PyEval_GetFrame(void)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  	return _PyThreadState_GetFrame(tstate);
  }

Index: codecs.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/codecs.c,v
retrieving revision 2.22
retrieving revision 2.23
diff -C2 -d -r2.22 -r2.23
*** codecs.c	29 Dec 2003 01:36:01 -0000	2.22
--- codecs.c	24 Mar 2004 22:22:11 -0000	2.23
***************
*** 29,33 ****
  int PyCodec_Register(PyObject *search_function)
  {
!     PyInterpreterState *interp = PyThreadState_Get()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	goto onError;
--- 29,33 ----
  int PyCodec_Register(PyObject *search_function)
  {
!     PyInterpreterState *interp = PyThreadState_GET()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	goto onError;
***************
*** 104,108 ****
      }
  
!     interp = PyThreadState_Get()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	goto onError;
--- 104,108 ----
      }
  
!     interp = PyThreadState_GET()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	goto onError;
***************
*** 396,400 ****
  int PyCodec_RegisterError(const char *name, PyObject *error)
  {
!     PyInterpreterState *interp = PyThreadState_Get()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	return -1;
--- 396,400 ----
  int PyCodec_RegisterError(const char *name, PyObject *error)
  {
!     PyInterpreterState *interp = PyThreadState_GET()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	return -1;
***************
*** 414,418 ****
      PyObject *handler = NULL;
  
!     PyInterpreterState *interp = PyThreadState_Get()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	return NULL;
--- 414,418 ----
      PyObject *handler = NULL;
  
!     PyInterpreterState *interp = PyThreadState_GET()->interp;
      if (interp->codec_search_path == NULL && _PyCodecRegistry_Init())
  	return NULL;
***************
*** 803,807 ****
      };
  
!     PyInterpreterState *interp = PyThreadState_Get()->interp;
      PyObject *mod;
      int i;
--- 803,807 ----
      };
  
!     PyInterpreterState *interp = PyThreadState_GET()->interp;
      PyObject *mod;
      int i;

Index: errors.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v
retrieving revision 2.81
retrieving revision 2.82
diff -C2 -d -r2.81 -r2.82
*** errors.c	20 Nov 2003 01:44:58 -0000	2.81
--- errors.c	24 Mar 2004 22:22:11 -0000	2.82
***************
*** 206,210 ****
  PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  
  	*p_type = tstate->curexc_type;
--- 206,210 ----
  PyErr_Fetch(PyObject **p_type, PyObject **p_value, PyObject **p_traceback)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  
  	*p_type = tstate->curexc_type;

Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.227
retrieving revision 2.228
diff -C2 -d -r2.227 -r2.228
*** import.c	23 Mar 2004 16:28:13 -0000	2.227
--- import.c	24 Mar 2004 22:22:12 -0000	2.228
***************
*** 322,326 ****
  PyImport_GetModuleDict(void)
  {
! 	PyInterpreterState *interp = PyThreadState_Get()->interp;
  	if (interp->modules == NULL)
  		Py_FatalError("PyImport_GetModuleDict: no module dictionary!");
--- 322,326 ----
  PyImport_GetModuleDict(void)
  {
! 	PyInterpreterState *interp = PyThreadState_GET()->interp;
  	if (interp->modules == NULL)
  		Py_FatalError("PyImport_GetModuleDict: no module dictionary!");
***************
*** 354,358 ****
  	char *name;
  	PyObject *key, *value, *dict;
! 	PyInterpreterState *interp = PyThreadState_Get()->interp;
  	PyObject *modules = interp->modules;
  
--- 354,358 ----
  	char *name;
  	PyObject *key, *value, *dict;
! 	PyInterpreterState *interp = PyThreadState_GET()->interp;
  	PyObject *modules = interp->modules;
  

Index: pystate.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pystate.c,v
retrieving revision 2.29
retrieving revision 2.30
diff -C2 -d -r2.29 -r2.30
*** pystate.c	13 Jul 2003 10:41:53 -0000	2.29
--- pystate.c	24 Mar 2004 22:22:12 -0000	2.30
***************
*** 314,318 ****
  int
  PyThreadState_SetAsyncExc(long id, PyObject *exc) {
! 	PyThreadState *tstate = PyThreadState_Get();
  	PyInterpreterState *interp = tstate->interp;
  	PyThreadState *p;
--- 314,318 ----
  int
  PyThreadState_SetAsyncExc(long id, PyObject *exc) {
! 	PyThreadState *tstate = PyThreadState_GET();
  	PyInterpreterState *interp = tstate->interp;
  	PyThreadState *p;

Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.204
retrieving revision 2.205
diff -C2 -d -r2.204 -r2.205
*** pythonrun.c	22 Mar 2004 20:16:58 -0000	2.204
--- pythonrun.c	24 Mar 2004 22:22:12 -0000	2.205
***************
*** 317,321 ****
  
  	/* Get current thread state and interpreter pointer */
! 	tstate = PyThreadState_Get();
  	interp = tstate->interp;
  
--- 317,321 ----
  
  	/* Get current thread state and interpreter pointer */
! 	tstate = PyThreadState_GET();
  	interp = tstate->interp;
  
***************
*** 530,534 ****
  	PyInterpreterState *interp = tstate->interp;
  
! 	if (tstate != PyThreadState_Get())
  		Py_FatalError("Py_EndInterpreter: thread is not current");
  	if (tstate->frame != NULL)
--- 530,534 ----
  	PyInterpreterState *interp = tstate->interp;
  
! 	if (tstate != PyThreadState_GET())
  		Py_FatalError("Py_EndInterpreter: thread is not current");
  	if (tstate->frame != NULL)
***************
*** 1462,1466 ****
  		break;
  	case E_DECODE: {	/* XXX */
! 		PyThreadState* tstate = PyThreadState_Get();
  		PyObject* value = tstate->curexc_value;
  		if (value != NULL) {
--- 1462,1466 ----
  		break;
  	case E_DECODE: {	/* XXX */
! 		PyThreadState* tstate = PyThreadState_GET();
  		PyObject* value = tstate->curexc_value;
  		if (value != NULL) {

Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.122
retrieving revision 2.123
diff -C2 -d -r2.122 -r2.123
*** sysmodule.c	24 Mar 2004 21:57:10 -0000	2.122
--- sysmodule.c	24 Mar 2004 22:22:12 -0000	2.123
***************
*** 49,53 ****
  PySys_GetObject(char *name)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  	PyObject *sd = tstate->interp->sysdict;
  	if (sd == NULL)
--- 49,53 ----
  PySys_GetObject(char *name)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  	PyObject *sd = tstate->interp->sysdict;
  	if (sd == NULL)
***************
*** 71,75 ****
  PySys_SetObject(char *name, PyObject *v)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  	PyObject *sd = tstate->interp->sysdict;
  	if (v == NULL) {
--- 71,75 ----
  PySys_SetObject(char *name, PyObject *v)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  	PyObject *sd = tstate->interp->sysdict;
  	if (v == NULL) {
***************
*** 87,91 ****
  {
  	PyObject *outf;
! 	PyInterpreterState *interp = PyThreadState_Get()->interp;
  	PyObject *modules = interp->modules;
  	PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
--- 87,91 ----
  {
  	PyObject *outf;
! 	PyInterpreterState *interp = PyThreadState_GET()->interp;
  	PyObject *modules = interp->modules;
  	PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
***************
*** 150,154 ****
  {
  	PyThreadState *tstate;
! 	tstate = PyThreadState_Get();
  	return Py_BuildValue(
  		"(OOO)",
--- 150,154 ----
  {
  	PyThreadState *tstate;
! 	tstate = PyThreadState_GET();
  	return Py_BuildValue(
  		"(OOO)",
***************
*** 169,173 ****
  sys_exc_clear(PyObject *self, PyObject *noargs)
  {
! 	PyThreadState *tstate = PyThreadState_Get();
  	PyObject *tmp_type, *tmp_value, *tmp_tb;
  	tmp_type = tstate->exc_type;
--- 169,173 ----
  sys_exc_clear(PyObject *self, PyObject *noargs)
  {
! 	PyThreadState *tstate = PyThreadState_GET();
  	PyObject *tmp_type, *tmp_value, *tmp_tb;
  	tmp_type = tstate->exc_type;
***************
*** 515,519 ****
  {
  	int new_val;
!         PyThreadState *tstate = PyThreadState_Get();
  	if (!PyArg_ParseTuple(args, "i:setdlopenflags", &new_val))
  		return NULL;
--- 515,519 ----
  {
  	int new_val;
!         PyThreadState *tstate = PyThreadState_GET();
  	if (!PyArg_ParseTuple(args, "i:setdlopenflags", &new_val))
  		return NULL;
***************
*** 538,542 ****
  sys_getdlopenflags(PyObject *self, PyObject *args)
  {
!         PyThreadState *tstate = PyThreadState_Get();
          if (!tstate)
  		return NULL;
--- 538,542 ----
  sys_getdlopenflags(PyObject *self, PyObject *args)
  {
!         PyThreadState *tstate = PyThreadState_GET();
          if (!tstate)
  		return NULL;
***************
*** 616,620 ****
  sys_getframe(PyObject *self, PyObject *args)
  {
! 	PyFrameObject *f = PyThreadState_Get()->frame;
  	int depth = -1;
  
--- 616,620 ----
  sys_getframe(PyObject *self, PyObject *args)
  {
! 	PyFrameObject *f = PyThreadState_GET()->frame;
  	int depth = -1;
  




More information about the Python-checkins mailing list