[3.6] bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() … · python/cpython@5dbb28e (original) (raw)
File tree
2 files changed
lines changed
- Misc/NEWS.d/next/Core and Builtins
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 | +Fix an assertion failure in `PyErr_WriteUnraisable()` in case of an | |
2 | +exception with a bad ``__module__`` attribute. Patch by Oren Milman. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -978,7 +978,7 @@ PyErr_WriteUnraisable(PyObject *obj) | ||
978 | 978 | } |
979 | 979 | |
980 | 980 | moduleName = _PyObject_GetAttrId(t, &PyId___module__); |
981 | -if (moduleName == NULL) { | |
981 | +if (moduleName == NULL | | |
982 | 982 | PyErr_Clear(); |
983 | 983 | if (PyFile_WriteString("", f) < 0) |
984 | 984 | goto done; |