Visitar URL original
More general adaptation of showsyntaxerror() to Python 3.13 by pushkarnk · Pull Request #1030 · bpython/bpython · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
pushkarnk committed Jan 16, 2025
commit 400f5eda1ae7859b88c81d591177b54128d0e835
2 changes: 1 addition & 1 deletion bpython/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def runsource(
return super().runsource(source, filename, symbol)

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