3 # Fix Python script(s) to reference the interpreter via /usr/bin/env python.
4 # Warning: this overwrites the file without making a backup.
11 for file in sys
.argv
[1:]:
15 print file, ': can\'t open :', msg
18 if not re
.match('^#! */usr/local/bin/python', line
):
19 print file, ': not a /usr/local/bin/python script'
24 line
= re
.sub('/usr/local/bin/python',
25 '/usr/bin/env python', line
)
26 print file, ':', `line`