From 5a9db90adb7088bbe489c98e535c791180211492 Mon Sep 17 00:00:00 2001 From: Clay McClure Date: Sat, 25 Feb 2012 22:48:59 -0500 Subject: Python requires -fwrapv for Decimal division According to: http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7 the Python interpreter must be built with -fwrapv for proper Decimal division. To test: python -c "from decimal import Decimal; print Decimal(4) / Decimal(2)" If built with -fwrapv, this yields 2. Closes #10487. Signed-off-by: Adam Vandenberg --- Library/Formula/python.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Library/Formula/python.rb') diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb index e4fa7f00d..748943f2d 100644 --- a/Library/Formula/python.rb +++ b/Library/Formula/python.rb @@ -40,6 +40,10 @@ class Python < Formula skip_clean ['bin', 'lib'] def install + # Python requires -fwrapv for proper Decimal division + # See: http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7 + ENV.append_to_cflags "-fwrapv" + if build_framework? and ARGV.include? "--static" onoe "Cannot specify both framework and static." exit 99 -- cgit v1.2.3