Skip to content

Commit bbb830f

Browse files
committed
Address review
1 parent 8a73b5d commit bbb830f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mypy/test/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ def __init__(
291291
data: str,
292292
line: int,
293293
) -> None:
294+
assert isinstance(parent, DataFileCollector)
294295
super().__init__(name, parent)
295296
self.suite = suite
296297
self.file = file

mypy/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ def initialize_win_colors(self) -> bool:
638638
# Windows ANSI escape sequences are only supported on Threshold 2 and above.
639639
# we check with an assert at runtime and an if check for mypy, as asserts do not
640640
# yet narrow platform
641-
assert sys.platform == "win32", "Running not on Windows"
642641
if sys.platform == "win32": # needed to find win specific sys apis
643642
winver = sys.getwindowsversion()
644643
if (
@@ -660,7 +659,8 @@ def initialize_win_colors(self) -> bool:
660659
| ENABLE_VIRTUAL_TERMINAL_PROCESSING,
661660
)
662661
self.initialize_vt100_colors()
663-
return True
662+
return True
663+
assert False, "Running not on Windows"
664664

665665
def initialize_unix_colors(self) -> bool:
666666
"""Return True if initialization was successful and we can use colors, False otherwise"""

0 commit comments

Comments
 (0)