Skip to content

Commit 78d7416

Browse files
committed
fix: __svtermstate default None
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent 8fa9c19 commit 78d7416

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/_pyrepl/unix_console.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def __init__(
160160
self.pollob.register(self.input_fd, select.POLLIN)
161161
self._poll_lock = threading.RLock()
162162
self._polling_thread: threading.Thread | None = None
163+
self.__svtermstate = None
163164
self.terminfo = terminfo.TermInfo(term or None)
164165
self.term = term
165166

@@ -804,7 +805,7 @@ def __tputs(self, fmt, prog=delayprog):
804805
# using .get() means that things will blow up
805806
# only if the bps is actually needed (which I'm
806807
# betting is pretty unlkely)
807-
if hasattr(self, '_UnixConsole__svtermstate'):
808+
if self.__svtermstate is not None:
808809
bps = ratedict.get(self.__svtermstate.ospeed)
809810
else:
810811
bps = None

0 commit comments

Comments
 (0)