https://github.com/python/cpython/commit/48d81b556e5d001e300ada7087e04a4095b122f2 commit: 48d81b556e5d001e300ada7087e04a4095b122f2 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: terryjreedy <[email protected]> date: 2026-10-09T13:32:30-04:00 summary:
[3.15] gh-136061: Simplify idlelib.editor.EditorWindow.load_extension methodname processing (GH-134874) (#156911) gh-136061: Simplify idlelib.editor.EditorWindow.load_extension methodname processing (GH-134874) (cherry picked from commit 0625799652a4876171103e985057ee3546441d95) Co-authored-by: John <[email protected]> files: M Lib/idlelib/editor.py diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index a040d791bdeb528..89e1725e15f30b0 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -1175,12 +1175,7 @@ def load_extension(self, name): if keydefs: self.apply_bindings(keydefs) for vevent in keydefs: - methodname = vevent.replace("-", "_") - while methodname[:1] == '<': - methodname = methodname[1:] - while methodname[-1:] == '>': - methodname = methodname[:-1] - methodname = methodname + "_event" + methodname = vevent.strip("<>").replace("-", "_") + "_event" if hasattr(ins, methodname): self.text.bind(vevent, getattr(ins, methodname)) _______________________________________________ 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]
