zopefoundation/persistent — pull request #7 by jamadden (2014-02-24 13:19:04+00:00)
Title: The pure-python Persistent class needs to support `del _p_jar`

When aborting a transaction that has added objects, ZODB tries to clean up the picklecache and remove the jar and oid of objects it has added. Before this commit, that failed:

txn.GLOBAL: ERROR: Failed to abort resource manager:
Traceback (most recent call last):
File "/transaction-1.4.1-py2.7.egg/transaction/_transaction.py", line 453, in abort
rm.abort(self)
File "/ZODB-4.0.0-py2.7.egg/ZODB/Connection.py", line 438, in abort
self._abort()
File "/ZODB-4.0.0-py2.7.egg/ZODB/Connection.py", line 456, in _abort
del obj._p_jar
File "/persistent-4.0.7-py2.7.egg/persistent/persistence.py", line 258, in __delattr__
object.__delattr__(self, name)
AttributeError: can't delete attribute

This commit makes it work like the C version.