[Python-checkins] CVS: python/dist/src/Python errors.c,2.50,2.51

Guido van Rossum python-dev@python.org
Mon, 7 Aug 2000 12:18:29 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24853

Modified Files:
	errors.c 
Log Message:
Avoid dumping core when PyErr_NormalizeException() is called without
an exception set.  This shouldn't happen, but we see it at times...


Index: errors.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v
retrieving revision 2.50
retrieving revision 2.51
diff -C2 -r2.50 -r2.51
*** errors.c	2000/07/22 18:47:25	2.50
--- errors.c	2000/08/07 19:18:27	2.51
***************
*** 137,140 ****
--- 137,146 ----
  	PyObject *inclass = NULL;
  
+ 	if (type == NULL) {
+ 		/* This is a bug.  Should never happen.  Don't dump core. */
+ 		PyErr_SetString(PyExc_SystemError,
+ 			"PyErr_NormalizeException() called without exception");
+ 	}
+ 
  	/* If PyErr_SetNone() was used, the value will have been actually
  	   set to NULL.