summaryrefslogtreecommitdiff
path: root/pexpect/replwrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'pexpect/replwrap.py')
-rw-r--r--pexpect/replwrap.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pexpect/replwrap.py b/pexpect/replwrap.py
index 83a09c2..1b91c67 100644
--- a/pexpect/replwrap.py
+++ b/pexpect/replwrap.py
@@ -88,9 +88,11 @@ class REPLWrapper(object):
if not cmdlines:
raise ValueError("No command was given")
+ res = u('')
self.child.sendline(cmdlines[0])
for line in cmdlines[1:]:
- self._expect_prompt(timeout=1)
+ self._expect_prompt(timeout=timeout)
+ res += self.child.before
self.child.sendline(line)
# Command was fully submitted, now wait for the next prompt
@@ -100,7 +102,7 @@ class REPLWrapper(object):
self._expect_prompt(timeout=1)
raise ValueError("Continuation prompt found - input was incomplete:\n"
+ command)
- return self.child.before
+ return res + self.child.before
def python(command="python"):
"""Start a Python shell and return a :class:`REPLWrapper` object."""