Commit f809b0eb authored by Barry Warsaw's avatar Barry Warsaw

zodb_pickle(): Use a lambda for convenience.

parent ad042e53
......@@ -37,12 +37,9 @@ ZERO = '\0'*8
def zodb_pickle(obj):
"""Create a pickle in the format expected by ZODB."""
def persistent_id(obj):
return getattr(obj, '_p_oid', None)
f = StringIO()
p = Pickler(f, 1)
p.persistent_id = persistent_id
p.persistent_id = lambda obj: getattr(obj, '_p_oid', None)
klass = obj.__class__
assert not hasattr(obj, '__getinitargs__'), "not ready for constructors"
args = None
......
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