Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an assertion failure in case of an exception with a bad ``__module__``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"in PyErr_WriteUnraisable()"

attribute. Patch by Oren Milman.
2 changes: 1 addition & 1 deletion Python/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ PyErr_WriteUnraisable(PyObject *obj)
}

moduleName = _PyObject_GetAttrId(t, &PyId___module__);
if (moduleName == NULL) {
if (moduleName == NULL || !PyUnicode_Check(moduleName)) {
PyErr_Clear();
if (PyFile_WriteString("<unknown>", f) < 0)
goto done;
Expand Down