summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-04-04 11:50:54 -0400
committerWilliam Deegan <bill@baddogconsulting.com>2017-04-04 11:50:54 -0400
commit958f13d462db786f927b70c7b7c4025c36171c49 (patch)
tree318f9d9a1a80f1df33c13695df5731451d8143f2 /QMTest
parent4de0a5953d4d68b03949d9b4917090fb76347955 (diff)
downloadscons-958f13d462db786f927b70c7b7c4025c36171c49.tar.gz
py2/3 ensure strings sent to process are bytes on win32. This fixes most fo the Interactive tests
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCmd.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index d9f59c07..2c0c0d38 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -736,8 +736,20 @@ class Popen(subprocess.Popen):
getattr(self, which).close()
setattr(self, which, None)
+
+ def to_bytes (s):
+ if isinstance (s, bytes) or bytes is str:
+ return s
+ return bytes (s, 'utf-8')
+
+ def to_str (s):
+ if bytes is str or is_String(s):
+ return s
+ return str (s, 'utf-8')
+
if sys.platform == 'win32':# and subprocess.mswindows:
def send(self, input):
+ input = to_bytes(input)
if not self.stdin:
return None