Automatic fixes to Python files

check=True was manually set when return code was checked later
This commit is contained in:
Geoffrey Frogeye 2025-05-08 17:56:11 +02:00
parent a3f4c2a932
commit 34b545890d
7 changed files with 22 additions and 33 deletions

View file

@ -13,8 +13,7 @@ NETWORKS_FILE = "/etc/keys/wireless_networks.json"
def wpa_cli(command: list[str]) -> list[bytes]:
command.insert(0, "wpa_cli")
process = subprocess.run(command, stdout=subprocess.PIPE)
process.check_returncode()
process = subprocess.run(command, stdout=subprocess.PIPE, check=True)
lines = process.stdout.splitlines()
while lines[0].startswith(b"Selected interface"):
lines.pop(0)

View file

@ -40,8 +40,7 @@ def list_networks() -> list[str]:
networks: list[dict[str, str | list[str] | int]] = list()
for path in list_networks():
proc = subprocess.run(["pass", path], stdout=subprocess.PIPE)
proc.check_returncode()
proc = subprocess.run(["pass", path], stdout=subprocess.PIPE, check=True)
raw = proc.stdout.decode()
split = raw.split("\n")