Skip to content

Commit f3b969e

Browse files
committed
Fix PopenSpawnExt adding setecho method
1 parent 017141a commit f3b969e

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

byexample/runner.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class PopenSpawnExt(pexpect.popen_spawn.PopenSpawn):
168168
to work more similar to pexpect's spawn class.
169169
'''
170170
def __init__(self, cmd, **kargs):
171-
kargs.pop('echo')
171+
self._echo = kargs.pop('echo')
172172
kargs.pop('dimensions')
173173

174174
self.delayafterclose = 0.1
@@ -180,6 +180,18 @@ def __init__(self, cmd, **kargs):
180180
def isalive(self):
181181
return bool(self.proc.poll())
182182

183+
# PopenSpawnExt does not really use or has the concept of "echo"
184+
# bu we fake it to have a more compatible API with Pexpect.Spawn
185+
def setecho(self, state):
186+
assert isinstance(state, bool)
187+
self._echo = state
188+
189+
def getecho(self):
190+
return self._echo
191+
192+
def waitnoecho(self):
193+
return
194+
183195
def sendcontrol(self, control):
184196
if control == 'c':
185197
self.kill(signal.SIGINT)

0 commit comments

Comments
 (0)