New submission from Michael Patrick O'Keefe <[EMAIL PROTECTED]>: The following call results in a ZeroDivisionError in python 2.5.2 and python 3.0 alpha 3 (I presume this is also an issue for Python 2.6 but I can't explicitly confirm):
>>> from test import pystone >>> pystone.main(10) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/test/pystone.py", line 61, in main benchtime, stones = pystones(loops) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/test/pystone.py", line 68, in pystones return Proc0(loops) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/test/pystone.py", line 131, in Proc0 return benchtime, (loops / benchtime) ZeroDivisionError: float division Note the patch I submitted checks if the benchtime is equal to 0.0 (which apparently happens on my Mac OS 10.5 PPC). If this is the case I arbitrarily set the benchtime to 1e-6. I'm not sure what the units of the benchtime variable is (seconds?). Anyhow, this fixes the issue but can someone review to confirm this is the correct behavior? Thanks! -Michael ---------- components: Library (Lib), Tests files: pystone_patch.txt messages: 69418 nosy: mokeefe severity: normal status: open title: pystone.main(10) causes ZeroDivisionError type: behavior versions: Python 2.5, Python 3.0 Added file: http://bugs.python.org/file10853/pystone_patch.txt _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3319> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com