Skip to content

Commit 6628006

Browse files
authored
[3.6]bpo-15786: Fix IDLE autocomplete return problem. (#2198) (#2199)
Before, Enter would not, for instance, complete 're.c' to 're.compile' even with 'compile' highlighted. Now it does. Before, '\n' was inserted into text, which in Shell meant compile() and possibly execute. Now cursor is left after completion. (cherry picked from commit 32fd874)
1 parent 789f47e commit 6628006

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/idlelib/autocomplete_w.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ def keypress_event(self, event):
325325
return "break"
326326

327327
elif keysym == "Return":
328+
self.complete()
328329
self.hide_window()
329-
return None
330+
return 'break'
330331

331332
elif (self.mode == COMPLETE_ATTRIBUTES and keysym in
332333
("period", "space", "parenleft", "parenright", "bracketleft",

0 commit comments

Comments
 (0)