diff options
author | Guido van Rossum <guido@python.org> | 1998-10-07 19:45:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-07 19:45:33 (GMT) |
commit | 19b23e538e8689950cfd2bcfbdbc30e9115fd48f (patch) | |
tree | 7c116f6bdc5a71131578bd7a5254bb7f3acc21f0 | |
parent | d076c73cc81a974794c9aa7e812931b74d6e03c2 (diff) | |
download | cpython-19b23e538e8689950cfd2bcfbdbc30e9115fd48f.zip cpython-19b23e538e8689950cfd2bcfbdbc30e9115fd48f.tar.gz cpython-19b23e538e8689950cfd2bcfbdbc30e9115fd48f.tar.bz2 |
Use the imp module to get the magic word.
-rwxr-xr-x | Tools/scripts/checkpyc.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Tools/scripts/checkpyc.py b/Tools/scripts/checkpyc.py index 6df0472..7be625c 100755 --- a/Tools/scripts/checkpyc.py +++ b/Tools/scripts/checkpyc.py @@ -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: |