Skip to content

Commit 296cd72

Browse files
committed
colors: fix bug in uncolored of empty colored strings
1 parent 77f0674 commit 296cd72

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

easypy/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def uncolored(text, ansi=True, markup=True):
324324
if ansi:
325325
text = re.sub(re.escape(ANSI_BEGIN) + '.+?m', "", text)
326326
if markup:
327-
text = RE_PARSE_COLOR_MARKUP.sub(lambda m: next(filter(None, m.groups()[1:])), text)
327+
text = RE_PARSE_COLOR_MARKUP.sub(lambda m: next(s for s in m.groups()[1:] if s is not None), text)
328328
return text
329329

330330

0 commit comments

Comments
 (0)