Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 28616:4f0b7acffc7d legacy-trunk
- pythunrun.c, Py_Finalize(): move the call to _Py_PrintReferences()
even farther down, to just before the call to
_PyObject_DebugMallocStats(). This required the following changes:
- pystate.c, PyThreadState_GetDict(): changed not to raise an
exception or issue a fatal error when no current thread state is
available, but simply return NULL without raising an exception
(ever).
- object.c, Py_ReprEnter(): when PyThreadState_GetDict() returns NULL,
don't raise an exception but return 0. This means that when
printing a container that's recursive, printing will go on and on
and on. But that shouldn't happen in the case we care about (see
first bullet).
- Updated Misc/NEWS and Doc/api/init.tex to reflect changes to
PyThreadState_GetDict() definition.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 15 Apr 2003 15:12:39 +0000 |
| parents | b1671550c7e1 |
| children | 9d4e138494fb |
comparison
equal
deleted
inserted
replaced
| 28615:b4b8fe2a632c | 28616:4f0b7acffc7d |
|---|---|
| 278 _PyExc_Fini(); | 278 _PyExc_Fini(); |
| 279 | 279 |
| 280 /* Clear interpreter state */ | 280 /* Clear interpreter state */ |
| 281 PyInterpreterState_Clear(interp); | 281 PyInterpreterState_Clear(interp); |
| 282 | 282 |
| 283 #ifdef Py_TRACE_REFS | |
| 284 /* Dump references -- this may implicitly need the thread state, | |
| 285 so this is the last possible place where we can do this. */ | |
| 286 if (Py_GETENV("PYTHONDUMPREFS")) { | |
| 287 _Py_PrintReferences(stderr); | |
| 288 } | |
| 289 #endif /* Py_TRACE_REFS */ | |
| 290 | |
| 291 /* Delete current thread */ | 283 /* Delete current thread */ |
| 292 PyThreadState_Swap(NULL); | 284 PyThreadState_Swap(NULL); |
| 293 PyInterpreterState_Delete(interp); | 285 PyInterpreterState_Delete(interp); |
| 294 | 286 |
| 295 /* Sundry finalizers */ | 287 /* Sundry finalizers */ |
| 311 - int and float free list blocks | 303 - int and float free list blocks |
| 312 - whatever various modules and libraries allocate | 304 - whatever various modules and libraries allocate |
| 313 */ | 305 */ |
| 314 | 306 |
| 315 PyGrammar_RemoveAccelerators(&_PyParser_Grammar); | 307 PyGrammar_RemoveAccelerators(&_PyParser_Grammar); |
| 308 | |
| 309 #ifdef Py_TRACE_REFS | |
| 310 /* Dump references -- this may implicitly need the thread state, | |
| 311 so this is the last possible place where we can do this. */ | |
| 312 if (Py_GETENV("PYTHONDUMPREFS")) { | |
| 313 _Py_PrintReferences(stderr); | |
| 314 } | |
| 315 #endif /* Py_TRACE_REFS */ | |
| 316 | 316 |
| 317 #ifdef PYMALLOC_DEBUG | 317 #ifdef PYMALLOC_DEBUG |
| 318 if (Py_GETENV("PYTHONMALLOCSTATS")) | 318 if (Py_GETENV("PYTHONMALLOCSTATS")) |
| 319 _PyObject_DebugMallocStats(); | 319 _PyObject_DebugMallocStats(); |
| 320 #endif | 320 #endif |
