Use new struct which supports standardized sizes

This commit is contained in:
Guido van Rossum 1997-01-11 19:22:11 +00:00
parent 88b85d4f63
commit 265b5b3f03
1 changed files with 2 additions and 5 deletions

View File

@ -41,12 +41,9 @@ def whichdb(filename):
# Convert to 4-byte int in native byte order -- return "" if impossible
try:
(magic,) = struct.unpack("l", s)
(magic,) = struct.unpack("=l", s)
except struct.error:
try:
(magic,) = struct.unpack("i", s)
except struct.error:
return ""
return ""
# Check for GNU dbm
if magic == 0x13579ace: