X Tutup
Skip to content

Commit 00dca53

Browse files
author
Marien Zwart
committed
Work around a minor bug in urwid 1.0.0.
1 parent 72d3122 commit 00dca53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bpython/urwid.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ def set_edit_markup(self, markup):
251251
252252
You should arrange for this to be called from the 'change' signal.
253253
"""
254-
self._bpy_text, self._bpy_attr = urwid.decompose_tagmarkup(markup)
254+
if markup:
255+
self._bpy_text, self._bpy_attr = urwid.decompose_tagmarkup(markup)
256+
else:
257+
# decompose_tagmarkup in some urwids fails on the empty list
258+
self._bpy_text, self._bpy_attr = '', []
255259
# This is redundant when we're called off the 'change' signal.
256260
# I'm assuming this is cheap, making that ok.
257261
self._invalidate()

0 commit comments

Comments
 (0)
X Tutup