[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - Full.py:1.40.2.6
Barry Warsaw
barry@wooz.org
Mon, 24 Jun 2002 11:34:00 -0400
Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv5384
Modified Files:
Tag: bsddb3Storage-picklelog-branch
Full.py
Log Message:
wrap the import of _helper in a try/except, since we'll force it to
fail if it can't compile. Reword the Python version of incr() to use
p64/U64.
=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Full.py 1.40.2.5 => 1.40.2.6 ===
#DNE = 'nonexist' # does not exist
-# Python 2.2
-#from _helper import incr
-# Python 2.1
-def incr(refcount, delta):
- return struct.pack('>Q', struct.unpack('>Q', refcount)[0] + delta)
+try:
+ # Python 2.2
+ from _helper import incr
+except ImportError:
+ # Python 2.1
+ def incr(refcount, delta):
+ return p64(U64(refcount) + delta)