Skip to content

Commit

Permalink
Actualizar el script a Python 3.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dato committed Oct 29, 2018
1 parent 64b4310 commit f22ce65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions abb_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

This comment has been minimized.

Copy link
@Savantage

Savantage Nov 3, 2018

@dato, en mi caso lo tuve que cambiar a "python3",
La versión es 3.6.6, usando Ubuntu 18.04.01

# coding: utf-8
#
# Copyright 2016 Adeodato Simó
Expand Down Expand Up @@ -193,7 +193,6 @@ def reset(self):

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

line = self.proc.stdout.readline()
self.proc.poll()
Expand All @@ -212,6 +211,8 @@ def setUp(self):
self.msg = None
self.seq = []
self.proc = subprocess.Popen(self.VALGRIND + [CMD_NAME],
bufsize=1, # Line-buffered.
universal_newlines=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Expand Down

0 comments on commit f22ce65

Please sign in to comment.