[Python-checkins] python/dist/src/Python errors.c,2.66.10.1,2.66.10.2

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 10 Apr 2003 13:30:24 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv28810

Modified Files:
      Tag: release22-maint
	errors.c 
Log Message:
Backport:
PyErr_NormalizeException(): in the type==NULL test, we should simply
return.  Setting an exception can mess with the exception state, and
continuing is definitely wrong (since type is dereferenced later on).
Some code that calls this seems to be prepared for a NULL exception
type, so let's be safe rather than sorry and simply assume there's
nothing to normalize in this case.


Index: errors.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v
retrieving revision 2.66.10.1
retrieving revision 2.66.10.2
diff -C2 -d -r2.66.10.1 -r2.66.10.2
*** errors.c	3 Mar 2002 21:32:01 -0000	2.66.10.1
--- errors.c	10 Apr 2003 20:30:18 -0000	2.66.10.2
***************
*** 132,138 ****
  
  	if (type == NULL) {
! 		/* This is a bug.  Should never happen.  Don't dump core. */
! 		PyErr_SetString(PyExc_SystemError,
! 			"PyErr_NormalizeException() called without exception");
  	}
  
--- 132,137 ----
  
  	if (type == NULL) {
! 		/* There was no exception, so nothing to do. */
! 		return;
  	}