Skip to content

Commit ee7a4a0

Browse files
committed
_pyrepl style changes
1 parent b081980 commit ee7a4a0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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:
@@ -574,8 +573,8 @@ def clear(self):
574573

575574
@property
576575
def input_hook(self):
577-
# avoid inline imports here so the repl doesn't get flooded with import
578-
# logging from -Ximporttime=2
576+
# avoid inline imports here so the repl doesn't get flooded
577+
# with import logging from -X importtime=2
579578
if posix is not None and posix._is_inputhook_installed():
580579
return posix._inputhook
581580

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)