Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8d6ba1c

Browse filesBrowse files
take simpler approach to decoding keywords
1 parent 79f75dc commit 8d6ba1c
Copy full SHA for 8d6ba1c

1 file changed

+3-3Lines changed: 3 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/autocomplete.py‎

Copy file name to clipboardExpand all lines: bpython/autocomplete.py
+3-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.