Skip to content

Commit 65eadf0

Browse files
committed
_pyrepl style changes
1 parent 673008c commit 65eadf0

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

Lib/_pyrepl/unix_console.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
# declare posix optional to allow None assignment on other platforms
4444
posix: types.ModuleType | None
45-
4645
try:
4746
import posix
4847
except ImportError:
@@ -558,8 +557,8 @@ def clear(self):
558557

559558
@property
560559
def input_hook(self):
561-
# avoid inline imports here so the repl doesn't get flooded with import
562-
# logging from -Ximporttime=2
560+
# avoid inline imports here so the repl doesn't get flooded
561+
# with import logging from -X importtime=2
563562
if posix is not None and posix._is_inputhook_installed():
564563
return posix._inputhook
565564

Lib/_pyrepl/windows_console.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def __init__(self, err: int | None, descr: str | None = None) -> None:
5959
self.err = err
6060
self.descr = descr
6161

62+
# declare nt optional to allow None assignment on other platforms
6263
nt: types.ModuleType | None
63-
6464
try:
6565
import nt
6666
except ImportError:
@@ -128,7 +128,7 @@ class _error(Exception):
128128

129129
def _supports_vt():
130130
try:
131-
nt._supports_virtual_terminal()
131+
return nt._supports_virtual_terminal()
132132
except AttributeError:
133133
return False
134134

@@ -241,8 +241,8 @@ def refresh(self, screen: list[str], c_xy: tuple[int, int]) -> None:
241241

242242
@property
243243
def input_hook(self):
244-
# avoid inline imports here so the repl doesn't get flooded with import
245-
# logging from -Ximporttime=2
244+
# avoid inline imports here so the repl doesn't get flooded
245+
# with import logging from -X importtime=2
246246
if nt is not None and nt._is_inputhook_installed():
247247
return nt._inputhook
248248

0 commit comments

Comments
 (0)