[rtems-tools commit] rtemstoolkit/macros: Convert all keys to str from unicode.

Chris Johns chrisj at rtems.org
Mon Jun 10 22:37:37 UTC 2019


Module:    rtems-tools
Branch:    master
Commit:    cbff4c8ca2b8f9a207e8538decae06ea81dbc2b1
Changeset: http://git.rtems.org/rtems-tools/commit/?id=cbff4c8ca2b8f9a207e8538decae06ea81dbc2b1

Author:    Chris Johns <chrisj at rtems.org>
Date:      Tue Jun 11 08:37:25 2019 +1000

rtemstoolkit/macros: Convert all keys to str from unicode.

---

 rtemstoolkit/macros.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rtemstoolkit/macros.py b/rtemstoolkit/macros.py
index e3776bd..d6a3563 100644
--- a/rtemstoolkit/macros.py
+++ b/rtemstoolkit/macros.py
@@ -232,6 +232,7 @@ class macros:
         return sorted(set(keys))
 
     def has_key(self, key):
+        key = self._unicode_to_str(key)
         if type(key) is not str:
             raise TypeError('bad key type (want str): %s' % (type(key)))
         if self.key_filter(key) not in list(self.keys()):
@@ -408,6 +409,7 @@ class macros:
                                 (path.host(self.expand(name))))
 
     def get(self, key):
+        key = self._unicode_to_str(key)
         if type(key) is not str:
             raise TypeError('bad key type: %s' % (type(key)))
         key = self.key_filter(key)



More information about the vc mailing list