Commit da470017 authored by Guido van Rossum's avatar Guido van Rossum

Use new struct which supports standardized sizes

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