diff options
| author | Georg Brandl <georg@python.org> | 2008-07-19 13:00:22 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2008-07-19 13:00:22 (GMT) |
| commit | 59ec315b0485cf383b7c8f65903d0194c562a10c (patch) | |
| tree | c616182dac3f6a117ea32fcae14524dbfb92a099 /Lib/test/pystone.py | |
| parent | 278fc50c07fcfb90b681c1401eaa9ed40bb1778c (diff) | |
| download | cpython-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.
Diffstat (limited to 'Lib/test/pystone.py')
| -rwxr-xr-x | Lib/test/pystone.py | 6 |
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() |
