Skip to content

Commit c1cc1f6

Browse files
JelleZijlstrahauntsaninja
authored and
hauntsaninja
committed
curses.tigetstr() can return None (python#11781)
Found by python/typeshed#6620
1 parent a0e75d6 commit c1cc1f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/util.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,12 @@ def initialize_unix_colors(self) -> bool:
566566
under = curses.tigetstr('smul')
567567
set_color = curses.tigetstr('setaf')
568568
set_eseq = curses.tigetstr('cup')
569+
normal = curses.tigetstr('sgr0')
569570

570-
if not (bold and under and set_color and set_eseq):
571+
if not (bold and under and set_color and set_eseq and normal):
571572
return False
572573

573-
self.NORMAL = curses.tigetstr('sgr0').decode()
574+
self.NORMAL = normal.decode()
574575
self.BOLD = bold.decode()
575576
self.UNDER = under.decode()
576577
self.DIM = parse_gray_color(set_eseq)

0 commit comments

Comments
 (0)