[Python-checkins] python/dist/src/Lib whichdb.py,1.13,1.14

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
2003年5月06日 13:42:13 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv20191
Modified Files:
	whichdb.py 
Log Message:
detect old version 2 hash files and return "bsddb185" as the appropriate
module to load them
Index: whichdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** whichdb.py	2 Aug 2002 17:12:15 -0000	1.13
--- whichdb.py	6 May 2003 20:42:10 -0000	1.14
***************
*** 87,95 ****
 return "gdbm"
 
! # Check for BSD hash
 if magic in (0x00061561, 0x61150600):
! return "dbhash"
 
! # BSD hash v2 has a 12-byte NULL pad in front of the file type
 try:
 (magic,) = struct.unpack("=l", s16[-4:])
--- 87,96 ----
 return "gdbm"
 
! # Check for old Berkeley db hash file format v2
 if magic in (0x00061561, 0x61150600):
! return "bsddb185"
 
! # Later versions of Berkeley db hash file have a 12-byte pad in
! # front of the file type
 try:
 (magic,) = struct.unpack("=l", s16[-4:])

AltStyle によって変換されたページ (->オリジナル) /