From 59ec315b0485cf383b7c8f65903d0194c562a10c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 19 Jul 2008 13:00:22 +0000 Subject: [PATCH] #3319: don't raise ZeroDivisionError if number of rounds is so low that benchtime is zero. --- Lib/test/pystone.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py index 0a25981eb68..c9892ff0758 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()