Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 86332:19ce90930e8b 3.3
Issue #18776: atexit callbacks now display their full traceback when they raise an exception.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sun, 13 Oct 2013 21:53:13 +0200 |
| parents | 7de9852cdc0e |
| children | 4c4f31a1b706 c13ef65f3dcf |
comparison
equal
deleted
inserted
replaced
| 86327:325fedff6178 | 86332:19ce90930e8b |
|---|---|
| 1878 void | 1878 void |
| 1879 PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) | 1879 PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb) |
| 1880 { | 1880 { |
| 1881 PyObject *seen; | 1881 PyObject *seen; |
| 1882 PyObject *f = PySys_GetObject("stderr"); | 1882 PyObject *f = PySys_GetObject("stderr"); |
| 1883 if (PyExceptionInstance_Check(value) | |
| 1884 && tb != NULL && PyTraceBack_Check(tb)) { | |
| 1885 /* Put the traceback on the exception, otherwise it won't get | |
| 1886 displayed. See issue #18776. */ | |
| 1887 PyObject *cur_tb = PyException_GetTraceback(value); | |
| 1888 if (cur_tb == NULL) | |
| 1889 PyException_SetTraceback(value, tb); | |
| 1890 else | |
| 1891 Py_DECREF(cur_tb); | |
| 1892 } | |
| 1883 if (f == Py_None) { | 1893 if (f == Py_None) { |
| 1884 /* pass */ | 1894 /* pass */ |
| 1885 } | 1895 } |
| 1886 else if (f == NULL) { | 1896 else if (f == NULL) { |
| 1887 _PyObject_Dump(value); | 1897 _PyObject_Dump(value); |
