[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 32fd874afe)
This commit is contained in:
terryjreedy 2017-06-14 16:10:10 -04:00 committed by GitHub
parent 789f47ebb5
commit 6628006941

View file

@ -325,8 +325,9 @@ class AutoCompleteWindow:
return "break"
elif keysym == "Return":
self.complete()
self.hide_window()
return None
return 'break'
elif (self.mode == COMPLETE_ATTRIBUTES and keysym in
("period", "space", "parenleft", "parenright", "bracketleft",