From b8e7f3cd15fe87be4f56bca4c633396037a7a670 Mon Sep 17 00:00:00 2001 From: Samuel John Date: Fri, 24 May 2013 20:10:54 +0200 Subject: python: Fix #19300 MAXREPEAT issue with system vim Related: http://bugs.python.org/issue18050 --- Library/Formula/python.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Library') diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb index 356944460..7cba22722 100644 --- a/Library/Formula/python.rb +++ b/Library/Formula/python.rb @@ -164,6 +164,16 @@ class Python < Formula install-lib=#{site_packages} EOF + # Work-around this bug: http://bugs.python.org/issue18050 + inreplace "#{prefix}/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", 'import sys', <<-EOS.undent + import sys + try: + from _sre import MAXREPEAT + except ImportError: + import _sre + _sre.MAXREPEAT = 65535 # this monkey-patches all other places of "from _sre import MAXREPEAT"' + EOS + makefile = prefix/'Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile' inreplace makefile do |s| unless MacOS::CLT.installed? -- cgit v1.2.3