Skip to content

Commit f22ce65

Browse files
committed
Actualizar el script a Python 3.
Usar universal_newlines para que proc.std{in,out,err} funcionen en modo texto. El script debería ser ahora compatible con Python 2 y 3.
1 parent 64b4310 commit f22ce65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

abb_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22
# coding: utf-8
33
#
44
# Copyright 2016 Adeodato Simó
@@ -193,7 +193,6 @@ def reset(self):
193193

194194
def _communicate(self, cmd, key=""):
195195
self.proc.stdin.write("{}{}\n".format(cmd, key))
196-
self.proc.stdin.flush()
197196

198197
line = self.proc.stdout.readline()
199198
self.proc.poll()
@@ -212,6 +211,8 @@ def setUp(self):
212211
self.msg = None
213212
self.seq = []
214213
self.proc = subprocess.Popen(self.VALGRIND + [CMD_NAME],
214+
bufsize=1, # Line-buffered.
215+
universal_newlines=True,
215216
stdin=subprocess.PIPE,
216217
stdout=subprocess.PIPE,
217218
stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)