Skip to content

Commit 9ba3de6

Browse files
committed
tools/mpy-tool.py: Implement freezing of Ellipsis const object.
1 parent 2cafef8 commit 9ba3de6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/mpy-tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ def freeze(self, parent_name):
287287
# generate constant objects
288288
for i, obj in enumerate(self.objs):
289289
obj_name = 'const_obj_%s_%u' % (self.escaped_name, i)
290-
if is_str_type(obj) or is_bytes_type(obj):
290+
if obj is Ellipsis:
291+
print('#define %s mp_const_ellipsis_obj' % obj_name)
292+
elif is_str_type(obj) or is_bytes_type(obj):
291293
if is_str_type(obj):
292294
obj = bytes_cons(obj, 'utf8')
293295
obj_type = 'mp_type_str'
@@ -328,7 +330,6 @@ def freeze(self, parent_name):
328330
print('STATIC const mp_obj_complex_t %s = {{&mp_type_complex}, %.16g, %.16g};'
329331
% (obj_name, obj.real, obj.imag))
330332
else:
331-
# TODO
332333
raise FreezeError(self, 'freezing of object %r is not implemented' % (obj,))
333334

334335
# generate constant table, if it has any entries

0 commit comments

Comments
 (0)