Skip to content

Commit

Permalink
Clear the error if the C extension proceeds without a __module__ or _…
Browse files Browse the repository at this point in the history
…_name__.
  • Loading branch information
jamadden committed Oct 20, 2018
1 parent 67447f2 commit f16a5aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions persistent/cPersistence.c
Expand Up @@ -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);
Expand Down

0 comments on commit f16a5aa

Please sign in to comment.