summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/parenmatch.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-08-11 03:44:54 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-08-11 03:44:54 (GMT)
commit3ff55a815559c91cfd8a7573e63ea6c3b7124484 (patch)
tree18c062df6cfcbee9f33f37ab41b96406c97e7302 /Lib/idlelib/parenmatch.py
parent40f70d1c057fb61eb24724950c237cd4b45a8cf5 (diff)
downloadcpython-3ff55a815559c91cfd8a7573e63ea6c3b7124484.zip
cpython-3ff55a815559c91cfd8a7573e63ea6c3b7124484.tar.gz
cpython-3ff55a815559c91cfd8a7573e63ea6c3b7124484.tar.bz2
Issue #27732: Silence test_idle with dummy bell functions.
Diffstat (limited to 'Lib/idlelib/parenmatch.py')
-rw-r--r--Lib/idlelib/parenmatch.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/idlelib/parenmatch.py b/Lib/idlelib/parenmatch.py
index 1428114..9586a3b 100644
--- a/Lib/idlelib/parenmatch.py
+++ b/Lib/idlelib/parenmatch.py
@@ -64,6 +64,7 @@ class ParenMatch:
# and deactivate_restore (which calls event_delete).
editwin.text.bind(self.RESTORE_VIRTUAL_EVENT_NAME,
self.restore_event)
+ self.bell = self.text.bell if self.BELL else lambda: None
self.counter = 0
self.is_restore_active = 0
self.set_style(self.STYLE)
@@ -93,7 +94,7 @@ class ParenMatch:
indices = (HyperParser(self.editwin, "insert")
.get_surrounding_brackets())
if indices is None:
- self.warn_mismatched()
+ self.bell()
return
self.activate_restore()
self.create_tag(indices)
@@ -109,7 +110,7 @@ class ParenMatch:
return
indices = hp.get_surrounding_brackets(_openers[closer], True)
if indices is None:
- self.warn_mismatched()
+ self.bell()
return
self.activate_restore()
self.create_tag(indices)
@@ -124,10 +125,6 @@ class ParenMatch:
if timer_count == self.counter:
self.restore_event()
- def warn_mismatched(self):
- if self.BELL:
- self.text.bell()
-
# any one of the create_tag_XXX methods can be used depending on
# the style