MCPcopy Index your code
hub / github.com/bpython/bpython / runsource

Method runsource

bpython/repl.py:138–152  ·  view source on GitHub ↗

Execute Python code. source, filename and symbol are passed on to code.InteractiveInterpreter.runsource.

(
        self,
        source: str,
        filename: str | None = None,
        symbol: str = "single",
    )

Source from the content-addressed store, hash-verified

136 self.timer = RuntimeTimer()
137
138 def runsource(
139 self,
140 source: str,
141 filename: str | None = None,
142 symbol: str = "single",
143 ) -> bool:
144 """Execute Python code.
145
146 source, filename and symbol are passed on to
147 code.InteractiveInterpreter.runsource."""
148
149 if filename is None:
150 filename = filename_for_console_input(source)
151 with self.timer:
152 return super().runsource(source, filename, symbol)
153
154 def showsyntaxerror(self, filename: str | None = None, **kwargs) -> None:
155 """Override the regular handler, the code's copied and pasted from

Callers 9

test_syntaxerrorMethod · 0.95
test_tracebackMethod · 0.95
startFunction · 0.80
startupMethod · 0.80
pushMethod · 0.80
exec_codeFunction · 0.80
_blocking_run_codeMethod · 0.80
initialize_interpMethod · 0.80

Calls 1