Skip to content

Commit 8bdb42e

Browse files
Add NOP encode parameter to curtsies interpreter
1 parent 3fb8441 commit 8bdb42e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bpython/curtsiesfrontend/interpreter.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pygments.lexers import get_lexer_by_name
1212

1313
from bpython.curtsiesfrontend.parse import parse
14-
from bpython.repl import RuntimeTimer
14+
from bpython.repl import Interpreter as ReplInterpreter
1515

1616
default_colors = {
1717
Generic.Error: 'R',
@@ -61,7 +61,7 @@ def format(self, tokensource, outfile):
6161
outfile.write(parse(o.rstrip()))
6262

6363

64-
class Interp(code.InteractiveInterpreter):
64+
class Interp(ReplInterpreter):
6565
def __init__(self, locals=None):
6666
"""Constructor.
6767
@@ -75,13 +75,13 @@ def __init__(self, locals=None):
7575
"""
7676
if locals is None:
7777
locals = {"__name__": "__console__", "__doc__": None}
78+
ReplInterpreter.__init__(self, locals)
7879
self.locals = locals
7980
self.compile = CommandCompiler()
8081

8182
# typically changed after being instantiated
8283
self.write = lambda stuff: sys.stderr.write(stuff)
8384
self.outfile = self
84-
self.timer = RuntimeTimer()
8585

8686
def showsyntaxerror(self, filename=None):
8787
"""Display the syntax error that just occurred.
@@ -160,11 +160,12 @@ def format(self, tbtext, lexer):
160160
cur_line.append((token, text))
161161
assert cur_line == [], cur_line
162162

163-
def runsource(self, source, filename="<input>", symbol="single"):
163+
def runsource(self, source, filename="<input>", symbol="single",
164+
encode=None):
165+
# TODO: encode does nothing
164166
with self.timer:
165167
return code.InteractiveInterpreter.runsource(
166-
self, source, filename=filename, symbol=symbol)
167-
168+
self, source, filename, symbol)
168169

169170
def code_finished_will_parse(s, compiler):
170171
"""Returns a tuple of whether the buffer could be complete and whether it

0 commit comments

Comments
 (0)