From: terryjreedy Date: Wed, 14 Jun 2017 19:43:15 +0000 (-0400) Subject: bpo-15786: Fix IDLE autocomplete return problem. (#2198) X-Git-Tag: v3.7.0a1~590 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32fd874afe55e396e3c9a5af35e7bb3d8e0b8f02;p=thirdparty%2FPython%2Fcpython.git bpo-15786: Fix IDLE autocomplete return problem. (#2198) Before, would not, for instance, complete 're.c' to 're.compile' even with 'compile' highlighted. Now it does. Before, was inserted into text, which in Shell meant compile() and possibly execute. Now cursor is left after completion. --- diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index e7354d0b95ba..7c3138f4040a 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -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",