https://github.com/python/cpython/commit/2fa3dcb66dce6878d1758518f32e97bf17dc91b2 commit: 2fa3dcb66dce6878d1758518f32e97bf17dc91b2 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: terryjreedy <[email protected]> date: 2026-09-24T05:08:07Z summary:
[3.13] gh-93966: Remove the syntax error highlighting in the IDLE Shell on the next statement (GH-157595) (#158059) gh-93966: Remove the syntax error highlighting in the IDLE Shell on the next statement (GH-157595) It stayed until the next syntax error. (cherry picked from commit 2483fb32062b99624303f6c203d5cbdba1de7cb3) Co-authored-by: Serhiy Storchaka <[email protected]> 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 30005e25d57891..c76c10f02beccb 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]
