summaryrefslogtreecommitdiffstats
path: root/Tools/idle
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-06-25 16:04:38 (GMT)
committerGuido van Rossum <guido@python.org>1999-06-25 16:04:38 (GMT)
commitdd4dda87c1b80e709417664487dfa7ab5581f4e6 (patch)
tree18d82fa7343d01e94887cbf91f9583eaba4c808b /Tools/idle
parent374c0dfb10ec9bebffbcc9ec30b37043fd13d6dc (diff)
downloadcpython-dd4dda87c1b80e709417664487dfa7ab5581f4e6.zip
cpython-dd4dda87c1b80e709417664487dfa7ab5581f4e6.tar.gz
cpython-dd4dda87c1b80e709417664487dfa7ab5581f4e6.tar.bz2
Add close() method that breaks cycles.
Diffstat (limited to 'Tools/idle')
-rw-r--r--Tools/idle/Percolator.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tools/idle/Percolator.py b/Tools/idle/Percolator.py
index a5f503f..9def5f4 100644
--- a/Tools/idle/Percolator.py
+++ b/Tools/idle/Percolator.py
@@ -12,6 +12,14 @@ class Percolator:
self.bottom.delete = self.redir.register("delete", self.delete)
self.filters = []
+ def close(self):
+ while self.top is not self.bottom:
+ self.removefilter(self.top)
+ self.top = None
+ self.bottom.setdelegate(None); self.bottom = None
+ self.redir.close(); self.redir = None
+ self.text = None
+
def insert(self, index, chars, tags=None):
# Could go away if inheriting from Delegator
self.top.insert(index, chars, tags)