summaryrefslogtreecommitdiff
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-27 13:26:03 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-27 13:26:03 +0300
commit8ace8e99b375f978111b62f2cc976ce4f55ecd6b (patch)
treec2b9862eb978830e5b986eeb23503e05bec4053d /Lib/rlcompleter.py
parent36b3fbb0ee6e266381cec91a0a3c15fd403c3cfd (diff)
downloadcpython-git-8ace8e99b375f978111b62f2cc976ce4f55ecd6b.tar.gz
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.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index d517c0e2d3..568cf3680f 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():