Skip to content

Commit

Permalink
curses.tigetstr() can return None (#11781)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Dec 17, 2021
1 parent 4602c4d commit 5253f7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mypy/util.py
Expand Up @@ -566,11 +566,12 @@ def initialize_unix_colors(self) -> bool:
under = curses.tigetstr('smul')
set_color = curses.tigetstr('setaf')
set_eseq = curses.tigetstr('cup')
normal = curses.tigetstr('sgr0')

if not (bold and under and set_color and set_eseq):
if not (bold and under and set_color and set_eseq and normal):
return False

self.NORMAL = curses.tigetstr('sgr0').decode()
self.NORMAL = normal.decode()
self.BOLD = bold.decode()
self.UNDER = under.decode()
self.DIM = parse_gray_color(set_eseq)
Expand Down

0 comments on commit 5253f7c

Please sign in to comment.