Automatic fixes to Python files
check=True was manually set when return code was checked later
This commit is contained in:
parent
a3f4c2a932
commit
34b545890d
7 changed files with 22 additions and 33 deletions
|
@ -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)
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue