comparison Python/pythonrun.c @ 44066:28c802837252

Merged revisions 59226-59233 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r59228 | amaury.forgeotdarc | 2007-11-29 21:24:36 +0100 (Thu, 29 Nov 2007) | 4 lines vc2008: Move python.vcproj first in the solution file, so that it becomes the default startup project when opening the file for the first time. ........ r59230 | georg.brandl | 2007-11-30 00:00:03 +0100 (Fri, 30 Nov 2007) | 3 lines Add more examples to the wsgiref docs. From GHOP by Josip Dzolonga. ........ r59231 | amaury.forgeotdarc | 2007-11-30 00:35:25 +0100 (Fri, 30 Nov 2007) | 7 lines Issue #1402: PyInterpreterState_Clear() may still invoke user code (in deallocation of running threads, for example), so the PyGILState_Release() function must still be functional. On the other hand, _PyGILState_Fini() only frees memory, and can be called later. Backport candidate, but only after some experts comment on it. ........
author Christian Heimes <christian@cheimes.de>
date Fri, 30 Nov 2007 14:35:04 +0000
parents 00048fedbaa0
children 0889daf6d0d9
comparison
equal deleted inserted replaced
44065:3ef6dbc43531 44066:28c802837252
465 */ 465 */
466 if (Py_GETENV("PYTHONDUMPREFS")) 466 if (Py_GETENV("PYTHONDUMPREFS"))
467 _Py_PrintReferences(stderr); 467 _Py_PrintReferences(stderr);
468 #endif /* Py_TRACE_REFS */ 468 #endif /* Py_TRACE_REFS */
469 469
470 /* Cleanup auto-thread-state */
471 #ifdef WITH_THREAD
472 _PyGILState_Fini();
473 #endif /* WITH_THREAD */
474
475 /* Clear interpreter state */ 470 /* Clear interpreter state */
476 PyInterpreterState_Clear(interp); 471 PyInterpreterState_Clear(interp);
477 472
478 /* Now we decref the exception classes. After this point nothing 473 /* Now we decref the exception classes. After this point nothing
479 can raise an exception. That's okay, because each Fini() method 474 can raise an exception. That's okay, because each Fini() method
480 below has been checked to make sure no exceptions are ever 475 below has been checked to make sure no exceptions are ever
481 raised. 476 raised.
482 */ 477 */
483 478
484 _PyExc_Fini(); 479 _PyExc_Fini();
480
481 /* Cleanup auto-thread-state */
482 #ifdef WITH_THREAD
483 _PyGILState_Fini();
484 #endif /* WITH_THREAD */
485 485
486 /* Delete current thread */ 486 /* Delete current thread */
487 PyThreadState_Swap(NULL); 487 PyThreadState_Swap(NULL);
488 PyInterpreterState_Delete(interp); 488 PyInterpreterState_Delete(interp);
489 489