cpython/Include/internal
Victor Stinner ef9d9b6312
bpo-36829: Add sys.unraisablehook() (GH-13187)
Add new sys.unraisablehook() function which can be overridden to
control how "unraisable exceptions" are handled. It is called when an
exception has occurred but there is no way for Python to handle it.
For example, when a destructor raises an exception or during garbage
collection (gc.collect()).

Changes:

* Add an internal UnraisableHookArgs type used to pass arguments to
  sys.unraisablehook.
* Add _PyErr_WriteUnraisableDefaultHook().
* The default hook now ignores exception on writing the traceback.
* test_sys now uses unittest.main() to automatically discover tests:
  remove test_main().
* Add _PyErr_Init().
* Fix PyErr_WriteUnraisable(): hold a strong reference to sys.stderr
  while using it
2019-05-22 11:28:22 +02:00
..
pycore_accu.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_atomic.h bpo-33608: Normalize atomic macros so that they all expect an atomic struct (GH-12877) 2019-04-22 11:13:11 -07:00
pycore_ceval.h bpo-36728: Remove PyEval_ReInitThreads() from C API (GH-13241) 2019-05-13 12:35:37 +02:00
pycore_condvar.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_context.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_coreconfig.h bpo-36763: Fix Python preinitialization (GH-13432) 2019-05-20 11:02:00 +02:00
pycore_fileutils.h bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422) 2019-03-19 01:46:25 +01:00
pycore_getopt.h bpo-36763: Cleanup precmdline in _PyCoreConfig_Read() (GH-13371) 2019-05-17 03:15:12 +02:00
pycore_gil.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_hamt.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_object.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_pathconfig.h bpo-36763: Remove _PyCoreConfig.dll_path (GH-13402) 2019-05-18 04:17:01 +02:00
pycore_pyhash.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_pylifecycle.h bpo-36829: Add sys.unraisablehook() (GH-13187) 2019-05-22 11:28:22 +02:00
pycore_pymem.h bpo-36763: Add PyMemAllocatorName (GH-13387) 2019-05-17 15:20:52 +02:00
pycore_pystate.h bpo-36710: Add 'ceval' local variable to ceval.c (GH-12934) 2019-05-10 23:39:09 +02:00
pycore_traceback.h bpo-35134: Split traceback.h header (GH-13430) 2019-05-20 00:14:57 +02:00
pycore_tupleobject.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00
pycore_warnings.h bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) 2019-04-17 23:02:26 +02:00