Skip to content

Commit

Permalink
try wexpect? - #12
Browse files Browse the repository at this point in the history
  • Loading branch information
jcartledge committed Jun 8, 2013
1 parent e82d2c2 commit 7da56e7
Show file tree
Hide file tree
Showing 3 changed files with 2,712 additions and 563 deletions.
6 changes: 2 additions & 4 deletions repl/repl.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
try:
import pexpect
from pexpect import spawn
except ImportError:
import winpexpect as pexpect
from winpexpect import winspawn as spawn
import wpexpect as pexpect

from ftfy import fix_text
import re
Expand Down Expand Up @@ -40,7 +38,7 @@ class ReplCloseError(Exception):

class Repl():
def __init__(self, cmd, prompt, prefix, error=[], timeout=10, cwd=None):
self.repl = spawn(cmd, timeout=timeout, cwd=cwd)
self.repl = pexpect.spawn(cmd, timeout=timeout, cwd=cwd)
base_prompt = [pexpect.EOF, pexpect.TIMEOUT]
self.prompt = base_prompt + self.repl.compile_pattern_list(prompt)
self.prefix = prefix
Expand Down
Loading

0 comments on commit 7da56e7

Please sign in to comment.