1111from pygments .lexers import get_lexer_by_name
1212
1313from bpython .curtsiesfrontend .parse import parse
14- from bpython .repl import RuntimeTimer
14+ from bpython .repl import Interpreter as ReplInterpreter
1515
1616default_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
169170def code_finished_will_parse (s , compiler ):
170171 """Returns a tuple of whether the buffer could be complete and whether it
0 commit comments