mirror of https://github.com/python/cpython
Use new struct which supports standardized sizes
This commit is contained in:
parent
88b85d4f63
commit
265b5b3f03
|
@ -41,10 +41,7 @@ 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:
|
|
||||||
try:
|
|
||||||
(magic,) = struct.unpack("i", s)
|
|
||||||
except struct.error:
|
except struct.error:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue