From: Guido van Rossum Date: Sat, 11 Jan 1997 19:22:11 +0000 (+0000) Subject: Use new struct which supports standardized sizes X-Git-Tag: v1.5a1~544 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=265b5b3f038a0baa5924b3a312da1874e55587f2;p=python Use new struct which supports standardized sizes --- diff --git a/Lib/whichdb.py b/Lib/whichdb.py index 3722e41b96..8985062d5d 100644 --- a/Lib/whichdb.py +++ b/Lib/whichdb.py @@ -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: