diff options
Diffstat (limited to 'rtemstoolkit')
-rwxr-xr-x | rtemstoolkit/execute.py | 3 | ||||
-rw-r--r-- | rtemstoolkit/macros.py | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/rtemstoolkit/execute.py b/rtemstoolkit/execute.py index 147d501..0dc9d4c 100755 --- a/rtemstoolkit/execute.py +++ b/rtemstoolkit/execute.py @@ -185,7 +185,8 @@ class execute(object): data = fh.read(1) if len(data) == 0: break - if type(data) == bytes: + # str and bytes are the same type in Python2 + if type(data) is not str and type(data) is bytes: data = data.decode(sys.stdout.encoding) for c in data: line += c diff --git a/rtemstoolkit/macros.py b/rtemstoolkit/macros.py index c9410ae..4eb8829 100644 --- a/rtemstoolkit/macros.py +++ b/rtemstoolkit/macros.py @@ -188,6 +188,7 @@ class macros: return macro[2] 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))) if type(value) is not tuple: |