[pypy-svn] r56600 - pypy/dist/pypy/lib

exarkun at codespeak.net exarkun at codespeak.net
Wed Jul 16 20:22:36 CEST 2008


Author: exarkun
Date: Wed Jul 16 20:22:36 2008
New Revision: 56600

Modified:
   pypy/dist/pypy/lib/imp.py
Log:
Use "i" instead of "L" so that the magic string comes out as 4 bytes, even on 64bit platforms

Modified: pypy/dist/pypy/lib/imp.py
==============================================================================
--- pypy/dist/pypy/lib/imp.py	(original)
+++ pypy/dist/pypy/lib/imp.py	Wed Jul 16 20:22:36 2008
@@ -25,7 +25,7 @@
     def get_magic():
         """Return the magic number for .pyc or .pyo files."""
         import struct
-        return struct.pack('L', _get_magic_as_int())
+        return struct.pack('<i', _get_magic_as_int())
 except ImportError:
     # XXX CPython testing hack: delegate to the real imp.get_magic
     get_magic = __import__('imp').get_magic



More information about the Pypy-commit mailing list