Fix buggy #! lines using "/usr/bin/env python2.7 -u".

The #! line processing interpreted the argument to pass to `env` as
"python2.7 -u", which obviously isn't a real program.

We fix this by setting the PYTHONUNBUFFERED environment variable
inside the program, which has the same effect.

Thanks to Dan Fedele for the bug report and suggested solution!
This commit is contained in:
Tim Abbott
2015-11-16 08:40:32 -08:00
parent ac35d26868
commit 7395003e6a
5 changed files with 14 additions and 5 deletions

View File

@@ -12,4 +12,5 @@ esac
cd "$(dirname "$0")"/..
./tools/generate-fixtures
# "-u" uses unbuffered IO, which is important when wrapping it in subprocess
/usr/bin/env python2.7 -u ./manage.py test "$target" --settings=zproject.test_settings "$@"
export PYTHONUNBUFFERED="y"
/usr/bin/env python2.7 ./manage.py test "$target" --settings=zproject.test_settings "$@"