Skip to content

Commit e6b739e

Browse files
committed
Decode attribute names
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent d8aaad8 commit e6b739e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

bpython/autocomplete.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,13 @@ def matches(self, cursor_offset, line, **kwargs):
342342
r = self.locate(cursor_offset, line)
343343
if r is None:
344344
return None
345+
345346
start, end, word = r
346347
attrs = dir('')
348+
if not py3:
349+
# decode attributes
350+
attrs = (att.decode('ascii') for att in attrs)
351+
347352
matches = set(att for att in attrs if att.startswith(word))
348353
if not word.startswith('_'):
349354
return set(match for match in matches if not match.startswith('_'))

0 commit comments

Comments
 (0)