]> granicus.if.org Git - python/commitdiff
Use the imp module to get the magic word.
authorGuido van Rossum <guido@python.org>
Wed, 7 Oct 1998 19:45:33 +0000 (19:45 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 7 Oct 1998 19:45:33 +0000 (19:45 +0000)
Tools/scripts/checkpyc.py

index 6df0472b28358c1c24d5927e36d718c76782fe77..7be625c3c48643d87d0eb87ec2235ec041ae62ef 100755 (executable)
@@ -5,6 +5,7 @@
 import sys
 import os
 from stat import ST_MTIME
+import imp
 
 def main():
        silent = 0
@@ -14,12 +15,7 @@ def main():
                        verbose = 1
                elif sys.argv[1] == '-s':
                        silent = 1
-       MAGIC = '\0\0\0\0'
-       try:
-               if sys.version[:5] >= '0.9.4':
-                       MAGIC = '\224\224\224\0'
-       except:
-               pass
+       MAGIC = imp.get_magic()
        if not silent:
                print 'Using MAGIC word', `MAGIC`
        for dirname in sys.path: