bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in cas… · python/cpython@f6e61df (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 |
---|---|---|
@@ -961,7 +961,7 @@ PyErr_WriteUnraisable(PyObject *obj) | ||
961 | 961 | } |
962 | 962 | |
963 | 963 | moduleName = _PyObject_GetAttrId(t, &PyId___module__); |
964 | -if (moduleName == NULL) { | |
964 | +if (moduleName == NULL | | |
965 | 965 | PyErr_Clear(); |
966 | 966 | if (PyFile_WriteString("", f) < 0) |
967 | 967 | goto done; |