summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-19 13:00:22 (GMT)
committerGeorg Brandl <georg@python.org>2008-07-19 13:00:22 (GMT)
commit59ec315b0485cf383b7c8f65903d0194c562a10c (patch)
treec616182dac3f6a117ea32fcae14524dbfb92a099
parent278fc50c07fcfb90b681c1401eaa9ed40bb1778c (diff)
downloadcpython-59ec315b0485cf383b7c8f65903d0194c562a10c.zip
cpython-59ec315b0485cf383b7c8f65903d0194c562a10c.tar.gz
cpython-59ec315b0485cf383b7c8f65903d0194c562a10c.tar.bz2
#3319: don't raise ZeroDivisionError if number of rounds is so
low that benchtime is zero.
-rwxr-xr-xLib/test/pystone.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py
index 0a25981..c9892ff 100755
--- a/Lib/test/pystone.py
+++ b/Lib/test/pystone.py
@@ -128,7 +128,11 @@ def Proc0(loops=LOOPS):
IntLoc1 = Proc2(IntLoc1)
benchtime = clock() - starttime - nulltime
- return benchtime, (loops / benchtime)
+ if benchtime == 0.0:
+ loopsPerBenchtime = 0.0
+ else:
+ loopsPerBenchtime = (loops / benchtime)
+ return benchtime, loopsPerBenchtime
def Proc1(PtrParIn):
PtrParIn.PtrComp = NextRecord = PtrGlb.copy()