somestruct = {
x = 0x12,
y = 0x34
}
$ python test.py
Traceback (most recent call last):
File "test.py", line 2, in <module>
test = cryptol.Cryptol().load_module(os.path.abspath('test.cry'))
File "/usr/local/lib/python2.7/site-packages/cryptol/cryptol.py", line 294, in load_module
mod = cls(port, req, self.__main_req, filepath)
File "/usr/local/lib/python2.7/site-packages/cryptol/cryptol.py", line 360, in __init__
val = self.__from_value(val_resp['value'])
File "/usr/local/lib/python2.7/site-packages/cryptol/cryptol.py", line 478, in __from_value
fname = field[0]['Name']
TypeError: list indices must be integers, not str
This patch seems to fix it for me, but I haven't tested it other than on my own use-cases:
diff --git a/cryptol/cryptol.py b/cryptol/cryptol.py
index 825a368..8f3a697 100644
--- a/cryptol/cryptol.py
+++ b/cryptol/cryptol.py
@@ -475,7 +475,7 @@ class _CryptolModule(object):
if 'record' in val:
rec = {}
for field in val['record']:
- fname = field[0]['Name']
+ fname = field[0][1]
fval = self.__from_value(field[1])
rec[fname] = fval
return rec