From 9ba3de6ea19a7c86f7ecd9ceefabbf732949e662 Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Wed, 15 Nov 2017 12:46:08 +1100
Subject: [PATCH] tools/mpy-tool.py: Implement freezing of Ellipsis const
 object.

---
 tools/mpy-tool.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py
index ac7b2c1cc..eeb760a5f 100755
--- a/tools/mpy-tool.py
+++ b/tools/mpy-tool.py
@@ -287,7 +287,9 @@ class RawCode:
         # generate constant objects
         for i, obj in enumerate(self.objs):
             obj_name = 'const_obj_%s_%u' % (self.escaped_name, i)
-            if is_str_type(obj) or is_bytes_type(obj):
+            if obj is Ellipsis:
+                print('#define %s mp_const_ellipsis_obj' % obj_name)
+            elif is_str_type(obj) or is_bytes_type(obj):
                 if is_str_type(obj):
                     obj = bytes_cons(obj, 'utf8')
                     obj_type = 'mp_type_str'
@@ -328,7 +330,6 @@ class RawCode:
                 print('STATIC const mp_obj_complex_t %s = {{&mp_type_complex}, %.16g, %.16g};'
                     % (obj_name, obj.real, obj.imag))
             else:
-                # TODO
                 raise FreezeError(self, 'freezing of object %r is not implemented' % (obj,))
 
         # generate constant table, if it has any entries
-- 
GitLab