Remove magic hack

It should be assumed that on modern development environments, python
is accessible to /usr/bin/env

Change the shebang as necessary and remove the magic hack.

This also means losing the -E option on the call to python, so that
PYTHONPATH and PYTHONHOME will be respected and local configuration
problems in those vars would be noticed

Change-Id: I6f0708ca7693f05a4c3621c338f03619563ba630
This commit is contained in:
David Pursehouse 2012-11-14 07:51:03 +09:00
parent 52f1e5d911
commit 8898e2f26d
2 changed files with 2 additions and 18 deletions

10
main.py
View File

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env python
# #
# Copyright (C) 2008 The Android Open Source Project # Copyright (C) 2008 The Android Open Source Project
# #
@ -14,14 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
magic='--calling-python-from-/bin/sh--'
"""exec" python -E "$0" "$@" """#$magic"
if __name__ == '__main__':
import sys
if sys.argv[-1] == '#%s' % magic:
del sys.argv[-1]
del magic
import getpass import getpass
import imp import imp
import netrc import netrc

10
repo
View File

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env python
## repo default configuration ## repo default configuration
## ##
@ -19,14 +19,6 @@ REPO_REV='stable'
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
magic='--calling-python-from-/bin/sh--'
"""exec" python -E "$0" "$@" """#$magic"
if __name__ == '__main__':
import sys
if sys.argv[-1] == '#%s' % magic:
del sys.argv[-1]
del magic
# increment this whenever we make important changes to this script # increment this whenever we make important changes to this script
VERSION = (1, 19) VERSION = (1, 19)