cmds / lib: Fix more static checker findings
Fix more errors and warnings produced by "make check" as reported by CI and a pyright upgrade. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
cdc1ce9f33
commit
24928c6f5d
16 changed files with 123 additions and 122 deletions
|
|
@ -84,16 +84,14 @@ class Result:
|
|||
if err is None:
|
||||
return False
|
||||
import re
|
||||
|
||||
return re.search(pattern, err) is not None
|
||||
|
||||
def __summarize(self, cmd: list[str] | None, wd: str | None = None) -> str:
|
||||
from .util import pretty_cmd
|
||||
if cmd is None:
|
||||
cmd = self.__cmd
|
||||
call = ''
|
||||
if cmd is not None:
|
||||
from .util import pretty_cmd
|
||||
|
||||
if wd is None:
|
||||
wd = self.__wd
|
||||
call = f'"{pretty_cmd(cmd, wd)}" '
|
||||
|
|
@ -164,7 +162,6 @@ class StatResult(NamedTuple):
|
|||
def from_os(cls, rhs: os.stat_result) -> StatResult:
|
||||
import grp
|
||||
import pwd
|
||||
|
||||
return StatResult(
|
||||
rhs.st_mode,
|
||||
pwd.getpwuid(rhs.st_uid).pw_name,
|
||||
|
|
|
|||
Loading…
Reference in a new issue