Skip to content

Commit

Permalink
Handle curses.tigetstr() returning None
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored Dec 17, 2021
1 parent 208672f commit 473788d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tornado/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ def __init__(
self._colors[levelno] = unicode_type(
curses.tparm(fg_color, code), "ascii"
)
self._normal = unicode_type(curses.tigetstr("sgr0"), "ascii")
normal = curses.tigetstr("sgr0")
if normal is not None:
self._normal = unicode_type(normal, "ascii")
else:
self._normal = ""
else:
# If curses is not present (currently we'll only get here for
# colorama on windows), assume hard-coded ANSI color codes.
Expand Down

0 comments on commit 473788d

Please sign in to comment.