From: Georg Brandl Date: Sat, 19 Jul 2008 13:00:22 +0000 (+0000) Subject: #3319: don't raise ZeroDivisionError if number of rounds is so X-Git-Tag: v2.6b3~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59ec315b0485cf383b7c8f65903d0194c562a10c;p=thirdparty%2FPython%2Fcpython.git #3319: don't raise ZeroDivisionError if number of rounds is so low that benchtime is zero. --- diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py index 0a25981eb68c..c9892ff07589 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()