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

Skip to content

Commit 499181a

Browse files
committed
Changed so that it replaces /usr/local/bin/python with /usr/bin/env python.
1 parent d5c58c3 commit 499181a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Tools/scripts/fixps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#! /usr/local/bin/python
1+
#! /usr/bin/env python
22

3-
# Fix Python script(s) to reference the interpreter in /usr/local/bin.
3+
# Fix Python script(s) to reference the interpreter via /usr/bin/env python.
44

55
import sys
66
import regex
@@ -15,13 +15,13 @@ def main():
1515
print file, ': can\'t open for update'
1616
continue
1717
line = f.readline()
18-
if regex.match('^#! */usr/local/python', line) < 0:
19-
print file, ': not a /usr/local/python script'
18+
if regex.match('^#! */usr/local/bin/python', line) < 0:
19+
print file, ': not a /usr/local/bin/python script'
2020
f.close()
2121
continue
2222
rest = f.read()
23-
line = regsub.sub('/usr/local/python', \
24-
'/usr/local/bin/python', line)
23+
line = regsub.sub('/usr/local/bin/python',
24+
'/usr/bin/env python', line)
2525
print file, ':', `line`
2626
f.seek(0)
2727
f.write(line)

0 commit comments

Comments
 (0)