Message69418
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 |
|
| Date |
User |
Action |
Args |
| 2008-07-08 08:44:06 | mokeefe | set | spambayes_score: 1.19243e-06 -> 1.1924271e-06 recipients:
+ mokeefe |
| 2008-07-08 08:44:06 | mokeefe | set | spambayes_score: 1.19243e-06 -> 1.19243e-06 messageid: <[email protected]> |
| 2008-07-08 08:44:04 | mokeefe | link | issue3319 messages |
| 2008-07-08 08:44:03 | mokeefe | create | |
|