diff options
author | William Blevins <wblevins001@gmail.com> | 2016-09-21 02:34:39 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-09-21 02:34:39 (GMT) |
commit | d81a3387f0c6ab528986d25bd57a27f549cd0c91 (patch) | |
tree | b5dcd222b55eb012eefc879b0296d9162e789564 /QMTest | |
parent | 191d1f1a9937ecdf16e12ad5610586c3ba7c50fd (diff) | |
download | SCons-d81a3387f0c6ab528986d25bd57a27f549cd0c91.zip SCons-d81a3387f0c6ab528986d25bd57a27f549cd0c91.tar.gz SCons-d81a3387f0c6ab528986d25bd57a27f549cd0c91.tar.bz2 |
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 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') |