diff options
author | William Blevins <wblevins001@gmail.com> | 2016-09-20 22:34:39 -0400 |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-09-20 22:34:39 -0400 |
commit | 86c73b209b34c29ce7d1c720259cb9dea962b4f4 (patch) | |
tree | b5dcd222b55eb012eefc879b0296d9162e789564 /QMTest | |
parent | e76e5f32cb0fd0b69339384f01d1ca5256cc8d9d (diff) | |
download | scons-86c73b209b34c29ce7d1c720259cb9dea962b4f4.tar.gz |
Updating to_str and to_bytes between QMTest and SCons.Util.
-Added check to skip decode if already string; otherwise, throws TypeError.
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCmd.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index d7b8d942..bff0d6aa 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') |