https://github.com/python/cpython/commit/2483fb32062b99624303f6c203d5cbdba1de7cb3 commit: 2483fb32062b99624303f6c203d5cbdba1de7cb3 branch: main author: Serhiy Storchaka <[email protected]> committer: terryjreedy <[email protected]> date: 2026-09-24T00:43:36-04:00 summary:
gh-93966: Remove the syntax error highlighting in the IDLE Shell on the next statement (#157595) It stayed until the next syntax error. Co-authored-by: André Roberge <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> files: A Misc/NEWS.d/next/IDLE/2026-09-15-22-10-17.gh-issue-93966.ch4fTB.rst M Lib/idlelib/pyshell.py diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 19a6569ac61182..1aeabba0a728fe 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -705,6 +705,8 @@ def execfile(self, filename, source=None): def runsource(self, source): "Extend base class method: Stuff the source in the line cache first" + # Remove the highlighting of a previous syntax error (gh-93966). + self.tkconsole.text.tag_remove("ERROR", "1.0", "end") filename = self.stuffsource(source) # at the moment, InteractiveInterpreter expects str assert isinstance(source, str) @@ -741,7 +743,6 @@ def showsyntaxerror(self, filename=None, **kwargs): """ tkconsole = self.tkconsole text = tkconsole.text - text.tag_remove("ERROR", "1.0", "end") type, value, tb = sys.exc_info() if not issubclass(type, SyntaxError): tkconsole.resetoutput() diff --git a/Misc/NEWS.d/next/IDLE/2026-09-15-22-10-17.gh-issue-93966.ch4fTB.rst b/Misc/NEWS.d/next/IDLE/2026-09-15-22-10-17.gh-issue-93966.ch4fTB.rst new file mode 100644 index 00000000000000..3260b42211b780 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2026-09-15-22-10-17.gh-issue-93966.ch4fTB.rst @@ -0,0 +1,2 @@ +The highlighting of a syntax error in the IDLE Shell is now removed when the +next statement is entered, not only when the next syntax error occurs. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
