Skip to content

Commit 82df1fc

Browse files
author
Ivan Levkivskyi
committed
Partial backport of #11785
1 parent 1521287 commit 82df1fc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mypy/typeshed/stdlib/_curses.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def termattrs() -> int: ...
344344
def termname() -> bytes: ...
345345
def tigetflag(__capname: str) -> int: ...
346346
def tigetnum(__capname: str) -> int: ...
347-
def tigetstr(__capname: str) -> bytes: ...
347+
def tigetstr(__capname: str) -> bytes | None: ...
348348
def tparm(
349349
__str: bytes,
350350
__i1: int = ...,

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)