summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-02-23 13:03:11 +1100
committerChris Johns <chrisj@rtems.org>2018-02-23 13:03:11 +1100
commit883dfa53a3a43c7114544eada6dd2a579f0458cf (patch)
tree353aeb36ca244fed4dca3f5ad8aab4b0e96662e1
parentsb: Option --source-only-download does not download the source. (diff)
downloadrtems-source-builder-883dfa53a3a43c7114544eada6dd2a579f0458cf.tar.bz2
sb: Convert any unicode keys to strings
Closes #3313
-rw-r--r--source-builder/sb/macros.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/source-builder/sb/macros.py b/source-builder/sb/macros.py
index 28a52b2..cf25783 100644
--- a/source-builder/sb/macros.py
+++ b/source-builder/sb/macros.py
@@ -150,7 +150,7 @@ class macros:
def __setitem__(self, key, value):
key = self._unicode_to_str(key)
if type(key) is not str:
- raise TypeError('bad key type (want str): %s' % (type(key)))
+ raise TypeError('bad key type (want str): %s (%s)' % (type(key), key))
if type(value) is not tuple:
value = self._unicode_to_str(value)
if type(value) is str:
@@ -396,6 +396,7 @@ class macros:
(path.host(self.expand(name))))
def get(self, key, globals = True, maps = None):
+ 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)
@@ -435,11 +436,10 @@ class macros:
return self.get_attribute(key) == 'override'
def define(self, key, value = '1'):
- if type(key) is not str:
- raise TypeError('bad key type: %s' % (type(key)))
self.__setitem__(key, ('none', 'none', value))
def undefine(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)