Commit f16a5aa0 authored by Jason Madden's avatar Jason Madden

Clear the error if the C extension proceeds without a __module__ or __name__.

parent 67447f2d
......@@ -1460,6 +1460,11 @@ Per_repr(cPersistentObject *self)
name = PyObject_GetAttrString((PyObject*)Py_TYPE(self), "__name__");
if (!module || !name) {
/*
Some error retrieving __module__ or __name__. Ignore it, use the
C data.
*/
PyErr_Clear();
result = PyUnicode_FromFormat("<%s object at %p%S%S%S>",
Py_TYPE(self)->tp_name, self,
oid_str, jar_str, prepr_exc_str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment