diff options
| -rw-r--r-- | QMTest/TestCmd.py | 9 | ||||
| -rw-r--r-- | src/engine/SCons/Util.py | 8 |
2 files changed, 6 insertions, 11 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index d7b8d94..bff0d6a 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -339,15 +339,12 @@ def is_List(e): def to_bytes (s): if isinstance (s, bytes) or bytes is str: return s - else: - return bytes (s, 'utf-8') + return bytes (s, 'utf-8') def to_str (s): - if bytes is str: + if bytes is str or is_String(s): return s - elif not is_String(s): - return str (s, 'utf-8') - return s + return str (s, 'utf-8') try: eval('unicode') diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 4f4ac2d..6a7e4a1 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -1553,14 +1553,12 @@ del __revision__ def to_bytes (s): if isinstance (s, bytes) or bytes is str: return s - else: - return bytes (s, 'utf-8') + return bytes (s, 'utf-8') def to_str (s): - if bytes is str: + if bytes is str or is_String(s): return s - else: - return str (s, 'utf-8') + return str (s, 'utf-8') # Local Variables: # tab-width:4 |
