Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19b23e5

Browse files
committed
Use the imp module to get the magic word.
1 parent d076c73 commit 19b23e5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Tools/scripts/checkpyc.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
import os
77
from stat import ST_MTIME
8+
import imp
89

910
def main():
1011
silent = 0
@@ -14,12 +15,7 @@ def main():
1415
verbose = 1
1516
elif sys.argv[1] == '-s':
1617
silent = 1
17-
MAGIC = '\0\0\0\0'
18-
try:
19-
if sys.version[:5] >= '0.9.4':
20-
MAGIC = '\224\224\224\0'
21-
except:
22-
pass
18+
MAGIC = imp.get_magic()
2319
if not silent:
2420
print 'Using MAGIC word', `MAGIC`
2521
for dirname in sys.path:

0 commit comments

Comments
 (0)