Skip to content

Commit 400f5ed

Browse files
committed
More general adaptation of showsyntaxerror() to Python 3.13
Python 3.13's code.InteractiveInterpreter adds a new **kwargs argument to its showsyntaxerror() method. Currently, the only use of it is to send a named argument of name "source". Whilst the current adapation of repl.Interpreter is specific and should work in the short term, here is a more general solution.
1 parent 5b31cca commit 400f5ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpython/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def runsource(
153153
return super().runsource(source, filename, symbol)
154154

155155
def showsyntaxerror(
156-
self, filename: Optional[str] = None, source: Optional[str] = None
156+
self, filename: Optional[str] = None, **kwargs
157157
) -> None:
158158
"""Override the regular handler, the code's copied and pasted from
159159
code.py, as per showtraceback, but with the syntaxerror callback called

0 commit comments

Comments
 (0)