##// END OF EJS Templates
Backport PR #4345: Make irunner compatible with upcoming pexpect 3.0 interface...
Thomas Kluyver -
Show More
@@ -39,6 +39,16 b' import sys'
39 from IPython.external import pexpect
39 from IPython.external import pexpect
40 from IPython.utils import py3compat
40 from IPython.utils import py3compat
41
41
42 # We want to use native strings on both versions of Python, and with two
43 # different versions of pexpect.
44 if py3compat.PY3:
45 try:
46 spawn = pexpect.spawnu # Pexpect 3.0 +
47 except AttributeError:
48 spawn = pexpect.spawn # pexpect-u fork
49 else:
50 spawn = pexpect.spawn
51
42 # Global usage strings, to avoid indentation issues when typing it below.
52 # Global usage strings, to avoid indentation issues when typing it below.
43 USAGE = """
53 USAGE = """
44 Interactive script runner, type: %s
54 Interactive script runner, type: %s
@@ -134,7 +144,7 b' class InteractiveRunner(object):'
134
144
135 # Create child process and hold on to it so we don't have to re-create
145 # Create child process and hold on to it so we don't have to re-create
136 # for every single execution call
146 # for every single execution call
137 c = self.child = pexpect.spawn(self.program,self.args,timeout=None)
147 c = self.child = spawn(self.program,self.args,timeout=None)
138 c.delaybeforesend = self.delaybeforesend
148 c.delaybeforesend = self.delaybeforesend
139 # pexpect hard-codes the terminal size as (24,80) (rows,columns).
149 # pexpect hard-codes the terminal size as (24,80) (rows,columns).
140 # This causes problems because any line longer than 80 characters gets
150 # This causes problems because any line longer than 80 characters gets
General Comments 0
You need to be logged in to leave comments. Login now