[Python-checkins] CVS: python/dist/src/Python compile.c,2.118,2.119

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


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

Modified Files:
	compile.c 
Log Message:
When returning an error from jcompile() (which is passed through by
PyNode_Compile()), make sure that an exception is actually set --
otherwise someone stomped on our error.  [2.0 checkin of this fix.]


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.118
retrieving revision 2.119
diff -C2 -r2.118 -r2.119
*** compile.c	2000/08/05 21:37:50	2.118
--- compile.c	2000/08/07 19:22:43	2.119
***************
*** 3294,3297 ****
--- 3294,3305 ----
  		Py_XDECREF(name);
  	}
+ 	else if (!PyErr_Occurred()) {
+ 		/* This could happen if someone called PyErr_Clear() after an
+ 		   error was reported above.  That's not supposed to happen,
+ 		   but I just plugged one case and I'm not sure there can't be
+ 		   others.  In that case, raise SystemError so that at least
+ 		   it gets reported instead dumping core. */
+ 		PyErr_SetString(PyExc_SystemError, "lost syntax error");
+ 	}
  	com_free(&sc);
  	return co;