App, lib, cmds: Remove unreachable code
Remove dead code paths detected by the new warn_unreachable mypy rule. These include: - Removed always-false isinstance checks (ssh/util.py, templates.py) - Removed unreachable return statements after raise (FileContext.py) - Removed unreachable None checks for typed variables (Result.py, ExecContext.py, CmdGetAuthInfo.py) - Simplified __uri function by removing impossible None check (CopyContext.py) - Changed assert False to explicit error (Cmd.py) - Removed unreachable None case from match (App.py) - Removed redundant outer case _: pass (pkg_relations.py) - Restructured stdin write to avoid unreachable warning (AsyncSSH.py) Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
a1d192b048
commit
c16e054aaa
11 changed files with 7 additions and 25 deletions
|
|
@ -210,9 +210,8 @@ class AsyncSSH(Base):
|
|||
except (BrokenPipeError, OSError):
|
||||
pass
|
||||
return
|
||||
if proc.stdin is None:
|
||||
return
|
||||
proc.stdin.write(data)
|
||||
if proc.stdin is not None:
|
||||
proc.stdin.write(data)
|
||||
await proc.stdin.drain()
|
||||
|
||||
async def _pump_stdout() -> None:
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ def join_cmd(
|
|||
"""
|
||||
ret: list[str] = []
|
||||
for token in cmd:
|
||||
if not isinstance(token, str):
|
||||
token = str(token)
|
||||
if token in operators:
|
||||
ret.append(token)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue