[Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.96,2.97

Barry Warsaw python-dev@python.org
Thu, 25 May 2000 16:09:51 -0700


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

Modified Files:
	pythonrun.c 
Log Message:
Py_Initialize(): Now that standard exceptions are builtin, we don't
need two phase init or fini of the builtin module.  Change the call of
_PyBuiltin_Init_1() to _PyBuiltin_Init().  Add a call to
init_exceptions().

Py_Finalize(): Don't call _PyBuiltin_Fini_1().  Instead call
fini_exceptions() but move this to before the thread state is
cleared.


Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.96
retrieving revision 2.97
diff -C2 -r2.96 -r2.97
*** pythonrun.c	2000/05/03 23:44:39	2.96
--- pythonrun.c	2000/05/25 23:09:49	2.97
***************
*** 153,157 ****
  	_PyCompareState_Key = PyString_InternFromString("cmp_state");
  
! 	bimod = _PyBuiltin_Init_1();
  	if (bimod == NULL)
  		Py_FatalError("Py_Initialize: can't initialize __builtin__");
--- 153,157 ----
  	_PyCompareState_Key = PyString_InternFromString("cmp_state");
  
! 	bimod = _PyBuiltin_Init();
  	if (bimod == NULL)
  		Py_FatalError("Py_Initialize: can't initialize __builtin__");
***************
*** 171,176 ****
  	_PyImport_Init();
  
  	/* phase 2 of builtins */
- 	_PyBuiltin_Init_2(interp->builtins);
  	_PyImport_FixupExtension("__builtin__", "__builtin__");
  
--- 171,178 ----
  	_PyImport_Init();
  
+ 	/* initialize builtin exceptions */
+ 	init_exceptions();
+ 
  	/* phase 2 of builtins */
  	_PyImport_FixupExtension("__builtin__", "__builtin__");
  
***************
*** 219,225 ****
  	PyOS_FiniInterrupts();
  
- 	/* Destroy PyExc_MemoryErrorInst */
- 	_PyBuiltin_Fini_1();
- 
  	/* Cleanup Unicode implementation */
  	_PyUnicode_Fini();
--- 221,224 ----
***************
*** 253,261 ****
  #endif /* Py_TRACE_REFS */
  
- 	/* Delete current thread */
- 	PyInterpreterState_Clear(interp);
- 	PyThreadState_Swap(NULL);
- 	PyInterpreterState_Delete(interp);
- 
  	/* Now we decref the exception classes.  After this point nothing
  	   can raise an exception.  That's okay, because each Fini() method
--- 252,255 ----
***************
*** 263,267 ****
  	   raised.
  	*/
! 	_PyBuiltin_Fini_2();
  	PyMethod_Fini();
  	PyFrame_Fini();
--- 257,267 ----
  	   raised.
  	*/
! 	fini_exceptions();
! 
! 	/* Delete current thread */
! 	PyInterpreterState_Clear(interp);
! 	PyThreadState_Swap(NULL);
! 	PyInterpreterState_Delete(interp);
! 
  	PyMethod_Fini();
  	PyFrame_Fini();