diff options
| author | Clay McClure | 2012-02-25 22:48:59 -0500 |
|---|---|---|
| committer | Adam Vandenberg | 2012-02-25 22:08:02 -0800 |
| commit | 5a9db90adb7088bbe489c98e535c791180211492 (patch) | |
| tree | d84d5347c15aac1f93796b263c1ee9929e32b468 /Library/Formula/python.rb | |
| parent | 855be1ec350c466f18e668ac76546fb55ea95d92 (diff) | |
| download | homebrew-5a9db90adb7088bbe489c98e535c791180211492.tar.bz2 | |
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 <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/python.rb')
| -rw-r--r-- | Library/Formula/python.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |
