Skip to content

Commit c79b3f6

Browse files
committed
lint 10/10!
1 parent a054d1b commit c79b3f6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

telnetlib3/server_pty_shell.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def start(self) -> None:
104104
105105
:raises PTYSpawnError: If the child process fails to exec.
106106
"""
107+
# pylint: disable=import-outside-toplevel
107108
# std imports
108109
import pty
109110
import fcntl
@@ -223,6 +224,7 @@ def _setup_child(
223224
) -> None:
224225
"""Child process setup before exec."""
225226
# Note: pty.fork() already calls setsid() for the child, so we don't need to
227+
# pylint: disable=import-outside-toplevel
226228
# std imports
227229
import fcntl
228230
import termios
@@ -263,6 +265,7 @@ def _setup_child(
263265

264266
def _setup_parent(self) -> None:
265267
"""Parent process setup after fork."""
268+
# pylint: disable=import-outside-toplevel
266269
# std imports
267270
import fcntl
268271

@@ -294,6 +297,7 @@ def _fire_naws_update(self) -> None:
294297

295298
def _set_window_size(self, rows: int, cols: int) -> None:
296299
"""Set PTY window size and send SIGWINCH to child."""
300+
# pylint: disable=import-outside-toplevel
297301
# std imports
298302
import fcntl
299303
import signal
@@ -310,6 +314,7 @@ def _set_window_size(self, rows: int, cols: int) -> None:
310314

311315
async def run(self) -> None:
312316
"""Bridge loop between telnet and PTY."""
317+
# pylint: disable=import-outside-toplevel
313318
# std imports
314319
import errno
315320

@@ -534,6 +539,7 @@ def _terminate(self, force: bool = False) -> bool:
534539
:param force: If True, use SIGKILL as last resort.
535540
:returns: True if child was terminated, False otherwise.
536541
"""
542+
# pylint: disable=import-outside-toplevel
537543
# std imports
538544
import signal
539545

telnetlib3/slc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,13 @@ def description_table(self) -> List[str]:
389389
mrk_cont = "(...)"
390390

391391
def continuing() -> bool:
392-
return bool(len(result) and result[-1] == mrk_cont)
392+
return bool(result and result[-1] == mrk_cont)
393393

394394
def is_last(mask: int) -> bool:
395395
return mask == len(self.value) - 1
396396

397397
def same_as_last(row: str) -> bool:
398-
return bool(len(result) and result[-1].endswith(row.split()[-1]))
398+
return bool(result and result[-1].endswith(row.split()[-1]))
399399

400400
for mask, byte in enumerate(self.value):
401401
if byte == 0:

0 commit comments

Comments
 (0)