diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-27 10:26:03 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-27 10:26:03 (GMT) |
commit | 8ace8e99b375f978111b62f2cc976ce4f55ecd6b (patch) | |
tree | c2b9862eb978830e5b986eeb23503e05bec4053d /Lib/rlcompleter.py | |
parent | 36b3fbb0ee6e266381cec91a0a3c15fd403c3cfd (diff) | |
download | cpython-8ace8e99b375f978111b62f2cc976ce4f55ecd6b.zip cpython-8ace8e99b375f978111b62f2cc976ce4f55ecd6b.tar.gz cpython-8ace8e99b375f978111b62f2cc976ce4f55ecd6b.tar.bz2 |
Issue #25209: rlcomplete now can add a space or a colon after completed keyword.
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r-- | Lib/rlcompleter.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py index d517c0e..568cf36 100644 --- a/Lib/rlcompleter.py +++ b/Lib/rlcompleter.py @@ -106,6 +106,12 @@ class Completer: n = len(text) for word in keyword.kwlist: if word[:n] == text: + if word in {'finally', 'try'}: + word = word + ':' + elif word not in {'False', 'None', 'True', + 'break', 'continue', 'pass', + 'else'}: + word = word + ' ' matches.append(word) for nspace in [builtins.__dict__, self.namespace]: for word, val in nspace.items(): |