aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-11-07 13:45:41 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-11-07 13:45:41 +0100
commit76440f4a8f46c2d9f3c25602116d965f4890be2b (patch)
treedde81c5c78ade6d17590e7d73bed5ac5617c2658
parentf8140c6025bc74bac355c1b8cefd4e7fd2d75901 (diff)
downloadtonkadur-python-interpreter-76440f4a8f46c2d9f3c25602116d965f4890be2b.zip
tonkadur-python-interpreter-76440f4a8f46c2d9f3c25602116d965f4890be2b.tar.bz2
bool to string cast returned incorrect values.
-rw-r--r--tonkadur.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tonkadur.py b/tonkadur.py
index b20b1bd..afae903 100644
--- a/tonkadur.py
+++ b/tonkadur.py
@@ -84,7 +84,11 @@ class Tonkadur:
content = self.compute(computation['content'])
if (target_type == "string"):
- return str(content)
+ if (origin_type == "bool"):
+ # Python would return True and False by default.
+ return "true" if content else "false"
+ else:
+ return str(content)
elif (target_type == "float"):
return float(content)
elif (target_type == "bool"):