X Tutup
Skip to content

Commit 8d6ba1c

Browse files
take simpler approach to decoding keywords
1 parent 79f75dc commit 8d6ba1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bpython/autocomplete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ def matches(self, cursor_offset, line, **kwargs):
286286
n = len(text)
287287
for word in keyword.kwlist:
288288
if method_match(word, n, text):
289-
word = try_decode(word, 'ascii') # py2 keywords are all ascii
290-
if word is not None:
291-
matches.add(word)
289+
if not py3:
290+
word = word.decode('ascii') # py2 keywords are all ascii
291+
matches.add(word)
292292
for nspace in [builtins.__dict__, locals_]:
293293
for word, val in nspace.items():
294294
if (method_match(word, len(text), text) and

0 commit comments

Comments
 (0)
X Tutup