beremiz

Runtime: py3 fix forcing of STRING

2023-07-20, Edouard Tisserant
a95b5ee1a0ea
Parents d311880b9d15
Children 5f0b02ab500c
Runtime: py3 fix forcing of STRING
--- a/runtime/typemapping.py Tue Jun 20 15:05:21 2023 +0200
+++ b/runtime/typemapping.py Thu Jul 20 16:16:05 2023 +0200
@@ -43,7 +43,7 @@
"BYTE": _t(c_uint8),
"STRING": (IEC_STRING,
lambda x: x.body[:x.len],
- lambda t, x: t(len(x), x)),
+ lambda t, x: t(len(x), x.encode() if type(x)==str else x)),
"INT": _t(c_int16),
"UINT": _t(c_uint16),
"WORD": _t(c_uint16),