python: Fix Homebrew/homebrew#19300 MAXREPEAT issue with system vim

Related:
http://bugs.python.org/issue18050
master
Samuel John 2013-05-24 20:10:54 +02:00
parent 87f3fe2916
commit ff3799c06f
1 changed files with 10 additions and 0 deletions

View File

@ -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?