Skip to content

Commit

Permalink
Partial backport of #11785
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Levkivskyi committed Dec 21, 2021
1 parent 1521287 commit 82df1fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mypy/typeshed/stdlib/_curses.pyi
Expand Up @@ -344,7 +344,7 @@ def termattrs() -> int: ...
def termname() -> bytes: ...
def tigetflag(__capname: str) -> int: ...
def tigetnum(__capname: str) -> int: ...
def tigetstr(__capname: str) -> bytes: ...
def tigetstr(__capname: str) -> bytes | None: ...
def tparm(
__str: bytes,
__i1: int = ...,
Expand Down
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 82df1fc

Please sign in to comment.