Skip to content

Commit ae9d55f

Browse files
committed
fix: mypy check issue
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent 1b8a228 commit ae9d55f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/_pyrepl/reader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import sys
2525
import _colorize
26+
from _colorize import Syntax
2627

2728
from contextlib import contextmanager
2829
from dataclasses import dataclass, field, fields
@@ -213,6 +214,7 @@ class Reader:
213214
lxy: tuple[int, int] = field(init=False)
214215
scheduled_commands: list[str] = field(default_factory=list)
215216
can_colorize: bool = False
217+
theme: Syntax | None = None
216218
threading_hook: Callback | None = None
217219

218220
## cached metadata to speed up screen refreshes
@@ -494,6 +496,7 @@ def get_prompt(self, lineno: int, cursor_on_line: bool) -> str:
494496

495497
if self.can_colorize:
496498
t = self.theme
499+
assert t is not None # theme is set when can_colorize is True
497500
prompt = f"{t.prompt}{prompt}{t.reset}"
498501
return prompt
499502

0 commit comments

Comments
 (0)