X Tutup
Skip to content

Commit d6fde7a

Browse files
committed
ANDY-MERGE
2 parents 920a9c4 + f794149 commit d6fde7a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bpython/cli.py

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,20 +1100,24 @@ def lsize():
11001100
if v_items:
11011101
self.list_win.addstr('\n ')
11021102

1103+
if not py3:
1104+
encoding = getpreferredencoding()
11031105
for ix, i in enumerate(v_items):
11041106
padding = (wl - len(i)) * ' '
11051107
if i == current_item:
11061108
color = get_colpair(self.config, 'operator')
11071109
else:
11081110
color = get_colpair(self.config, 'main')
11091111
if not py3:
1110-
i = i.encode(getpreferredencoding())
1112+
i = i.encode(encoding)
11111113
self.list_win.addstr(i + padding, color)
11121114
if ((cols == 1 or (ix and not (ix + 1) % cols))
11131115
and ix + 1 < len(v_items)):
11141116
self.list_win.addstr('\n ')
11151117

11161118
if self.docstring is not None:
1119+
if not py3:
1120+
docstring_string = docstring_string.encode(encoding, 'ignore')
11171121
self.list_win.addstr('\n' + docstring_string,
11181122
get_colpair(self.config, 'comment'))
11191123
# XXX: After all the trouble I had with sizing the list box (I'm not very good

0 commit comments

Comments
 (0)
X Tutup