[Python-Dev] simple syntax error bombs interpreter

Vladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Wed, 12 Jul 2000 21:29:43 +0200 (CEST)


Fredrik Lundh wrote:
> 
> using my latest Python 2.0 build, the interpreter
> bombs if I type the following two commands:
> 
> >>> def a(b):
> ...     global b
> ...
> 
> (1.5.2 says "name is local and global").
> 
> </F>
> 

Yes. This is because PyErr_PrintEx() is invoked with a NULL exception.
And the exception has been cleared cleared in get_inprogress_dict().

The appended patch should fix it. Let me know whether it works for you.

Jeremy, what's the point of calling PyErr_Clear() in get_inprogress_dict()?

-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252

------------------------------[ cut here ]----------------------------
*** CVS/Objects/object.c	Wed Jul 12 17:27:41 2000
--- dev/Objects/object.c	Wed Jul 12 21:21:52 2000
***************
*** 356,362 ****
  	} 
  	inprogress = PyDict_GetItem(tstate_dict, _PyCompareState_Key); 
  	if (inprogress == NULL) {
- 		PyErr_Clear();
  		inprogress = PyDict_New();
  		if (inprogress == NULL)
  			return NULL;
--- 356,361 ----