mirror of
https://github.com/python/cpython.git
synced 2025-09-25 01:43:11 +00:00
Use the imp module to get the magic word.
This commit is contained in:
parent
d076c73cc8
commit
19b23e538e
1 changed files with 2 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from stat import ST_MTIME
|
from stat import ST_MTIME
|
||||||
|
import imp
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
silent = 0
|
silent = 0
|
||||||
|
@ -14,12 +15,7 @@ def main():
|
||||||
verbose = 1
|
verbose = 1
|
||||||
elif sys.argv[1] == '-s':
|
elif sys.argv[1] == '-s':
|
||||||
silent = 1
|
silent = 1
|
||||||
MAGIC = '\0\0\0\0'
|
MAGIC = imp.get_magic()
|
||||||
try:
|
|
||||||
if sys.version[:5] >= '0.9.4':
|
|
||||||
MAGIC = '\224\224\224\0'
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
if not silent:
|
if not silent:
|
||||||
print 'Using MAGIC word', `MAGIC`
|
print 'Using MAGIC word', `MAGIC`
|
||||||
for dirname in sys.path:
|
for dirname in sys.path:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue