[Python-checkins] cpython: Fix Overflow exception in the bignum factorial benchmark that is due to

stefan.krah python-checkins at python.org
Sun Apr 1 23:27:04 CEST 2012


http://hg.python.org/cpython/rev/1f5701ffa077
changeset:   76055:1f5701ffa077
user:        Stefan Krah <skrah at bytereef.org>
date:        Sun Apr 01 23:25:34 2012 +0200
summary:
  Fix Overflow exception in the bignum factorial benchmark that is due to
the recent change of the default value for context.Emax.

files:
  Modules/_decimal/tests/bench.py |  5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Modules/_decimal/tests/bench.py b/Modules/_decimal/tests/bench.py
--- a/Modules/_decimal/tests/bench.py
+++ b/Modules/_decimal/tests/bench.py
@@ -84,7 +84,10 @@
 print("#                               Factorial")
 print("# ======================================================================\n")
 
-C.getcontext().prec = C.MAX_PREC
+c = C.getcontext()
+c.prec = C.MAX_PREC
+c.Emax = C.MAX_EMAX
+c.Emin = C.MIN_EMIN
 
 for n in [100000, 1000000]:
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list