aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/python.rb
diff options
context:
space:
mode:
authorSamuel John2013-08-09 18:34:34 +0200
committerSamuel John2013-08-09 18:37:03 +0200
commit2681f48e849825505516f0f9396dc833a834f360 (patch)
treedcbf6378b16edcf62cd927032723e6b673da0c4c /Library/Formula/python.rb
parent1bc77740059420cdd1cfe901838eb3013760f7be (diff)
downloadhomebrew-2681f48e849825505516f0f9396dc833a834f360.tar.bz2
python: Use patch (from upstream) instead of inreplace
This patch is different than my earlier ad-hoc solution, but it took some time until upstream devs came up with the proper fix. However, we can't directly link to the patch (from the mercurial web repo), as it also changes the NEWS text and the patch fails to apply. Further, the mercurial repo is only http (no "s").
Diffstat (limited to 'Library/Formula/python.rb')
-rw-r--r--Library/Formula/python.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb
index 076252704..4fb6569b5 100644
--- a/Library/Formula/python.rb
+++ b/Library/Formula/python.rb
@@ -92,10 +92,6 @@ class Python < Formula
f.gsub! 'DEFAULT_FRAMEWORK_FALLBACK = [', "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks',"
end
- # Fix http://bugs.python.org/issue18071
- inreplace "./Lib/_osx_support.py", "compiler_so = list(compiler_so)",
- "if isinstance(compiler_so, (str,unicode)): compiler_so = compiler_so.split()"
-
if build.with? 'brewed-tk'
ENV.append 'CPPFLAGS', "-I#{Formula.factory('tcl-tk').opt_prefix}/include"
ENV.append 'LDFLAGS', "-L#{Formula.factory('tcl-tk').opt_prefix}/lib"
@@ -263,6 +259,29 @@ class Python < Formula
end
__END__
+# http://bugs.python.org/issue18071 (Remove this hung for 2.7.6!)
+diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
+--- a/Lib/_osx_support.py
++++ b/Lib/_osx_support.py
+@@ -53,7 +53,7 @@ def _find_executable(executable, path=No
+
+
+ def _read_output(commandstring):
+- """Output from succesful command execution or None"""
++ """Output from successful command execution or None"""
+ # Similar to os.popen(commandstring, "r").read(),
+ # but without actually using os.popen because that
+ # function is not usable during python bootstrap.
+@@ -68,7 +68,7 @@ def _read_output(commandstring):
+
+ with contextlib.closing(fp) as fp:
+ cmd = "%s 2>/dev/null >'%s'" % (commandstring, fp.name)
+- return fp.read().decode('utf-8').strip() if not os.system(cmd) else None
++ return fp.read().strip() if not os.system(cmd) else None
+
+
+# X11 header find fix (and let homebrew handle this.)
+
diff --git a/setup.py b/setup.py
index 716f08e..66114ef 100644
--- a/setup.py