Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-12 02:45:11 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-12 02:45:11 (GMT)
commitc2648fa911286349d12dbb11b01ef08a677b8901 (patch)
tree677639fd7c4a0154e9e9782a2794ea0dd33976dc /tawindow.py
parent00011244f334884e890a8d39f91ee1080ba6b985 (diff)
convert numeric strings to float
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tawindow.py b/tawindow.py
index 7b2edee..43e9bfb 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -1525,9 +1525,15 @@ class TurtleArtWindow():
b2.name in ['product2', 'minus2', 'sqrt', 'division2', 'random',
'remainder2', 'string']:
if b1.name == 'string' and len(b1.values[0]) != 1:
- return False
+ try:
+ float(b1.values[0])
+ except ValueError:
+ return False
elif b2.name == 'string' and len(b2.values[0]) != 1:
- return False
+ try:
+ float(b2.values[0])
+ except ValueError:
+ return False
return True
"""