Opened 13 years ago
Closed 13 years ago
#2313 closed defect (fixed)
Trap all math overflow errors in function block
Reported by: | tonyforster | Owned by: | walter |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Turtleart | Version: | Unspecified |
Severity: | Unspecified | Keywords: | |
Cc: | Distribution/OS: | Unspecified | |
Bug Status: | Unconfirmed |
Description
Currently the python function block will give a bad dock visual indication for function=1/0
but for function=log(0) and sqrt(-1), all that happens is that the turtle disappears and an error is logged
can we have a bad dock indication?
Attachments (1)
Change History (12)
comment:1 Changed 13 years ago by walter
comment:2 Changed 13 years ago by tonyforster
ZeroDivisionError is OK? print function block (1/0) shows block dock error
comment:3 Changed 13 years ago by walter
- Resolution set to fixed
- Status changed from new to closed
v97 seems to mostly do the right thing.
comment:4 Changed 13 years ago by tonyforster
See also #2314, redundant math. brings in a different library
math.log(0) and math.sqrt(-1) are trapped OK
but
log(0) is not trapped
and
sqrt(-1) returns NAN
comment:5 Changed 13 years ago by tonyforster
- Resolution fixed deleted
- Status changed from closed to reopened
comment:6 Changed 13 years ago by walter
See explanation in #2314. Should be behaving properly in v99
comment:7 Changed 13 years ago by walter
comment:8 Changed 13 years ago by walter
- Resolution set to fixed
- Status changed from reopened to closed
comment:9 Changed 13 years ago by tonyforster
- Resolution fixed deleted
- Status changed from closed to reopened
File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/talogo.py", line 855, in myfunction
raise logoerror('#' + str(e))
UnboundLocalError: local variable 'e' referenced before assignment
comment:10 Changed 13 years ago by walter
comment:11 Changed 13 years ago by walter
- Resolution set to fixed
- Status changed from reopened to closed
Probably should trap NameError and ZeroDivisionError too.