diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2006-12-15 05:13:11 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2006-12-15 05:13:11 (GMT) |
commit | c3200b97d6f7dff43c094ab7dd6cd91da879e5d8 (patch) | |
tree | 2199cca5343fdd3ce6c703e2662727065c2c6da2 /Lib/idlelib/AutoCompleteWindow.py | |
parent | 1646568b5ed4a3d11e1bf938048b01d7ae3dd0f7 (diff) | |
download | cpython-c3200b97d6f7dff43c094ab7dd6cd91da879e5d8.zip cpython-c3200b97d6f7dff43c094ab7dd6cd91da879e5d8.tar.gz cpython-c3200b97d6f7dff43c094ab7dd6cd91da879e5d8.tar.bz2 |
1. Avoid hang when encountering a duplicate in a completion list. Bug 1571112.
2. Duplicate some old entries from Python's NEWS to IDLE's NEWS.txt
M AutoCompleteWindow.py
M NEWS.txt
Diffstat (limited to 'Lib/idlelib/AutoCompleteWindow.py')
-rw-r--r-- | Lib/idlelib/AutoCompleteWindow.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py index d8bbff4..d02a695 100644 --- a/Lib/idlelib/AutoCompleteWindow.py +++ b/Lib/idlelib/AutoCompleteWindow.py @@ -118,8 +118,11 @@ class AutoCompleteWindow: i = 0 while i < len(lts) and i < len(selstart) and lts[i] == selstart[i]: i += 1 - while cursel > 0 and selstart[:i] <= self.completions[cursel-1]: + previous_completion = self.completions[cursel - 1] + while cursel > 0 and selstart[:i] <= previous_completion: i += 1 + if selstart == previous_completion: + break # maybe we have a duplicate? newstart = selstart[:i] self._change_start(newstart) |