python: patch the shebang in cgi.py.

BUG=None
TEST=Tested locally on a guado

Change-Id: I8b09edd3e8faff1eac611971303125d5233eab4c
Reviewed-on: https://chromium-review.googlesource.com/526268
Commit-Ready: Tim Zwiebel <timzwiebel@google.com>
Tested-by: Tim Zwiebel <timzwiebel@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/dev-lang/python/python-2.7.10-r1.ebuild b/dev-lang/python/python-2.7.10-r1.ebuild
new file mode 120000
index 0000000..262e549
--- /dev/null
+++ b/dev-lang/python/python-2.7.10-r1.ebuild
@@ -0,0 +1 @@
+python-2.7.10.ebuild
\ No newline at end of file
diff --git a/dev-lang/python/python-2.7.10.ebuild b/dev-lang/python/python-2.7.10.ebuild
index d9eebdc..5f69044 100644
--- a/dev-lang/python/python-2.7.10.ebuild
+++ b/dev-lang/python/python-2.7.10.ebuild
@@ -91,6 +91,11 @@
 }
 
 src_prepare() {
+	# According to the comments at the top of cgi.py, Linux vendors need to
+	# patch the shebang in cgi.py. We'll ignore the comment about not using
+	# "/usr/bin/env python" and use it anyway.
+	sed -i -e '1 s:^#!.*$:#! /usr/bin/env python:' Lib/cgi.py || die
+
 	# Ensure that internal copies of expat, libffi and zlib are not used.
 	rm -r Modules/expat || die
 	rm -r Modules/_ctypes/libffi* || die