fix communicate and await

This commit is contained in:
Robert McMahon 2026-02-13 15:34:47 -08:00
parent e09456aab9
commit 96aab517af
1 changed files with 3 additions and 6 deletions

View File

@ -227,8 +227,7 @@ class WiFiMonitor:
stdout=asyncio.subprocess.DEVNULL, stdout=asyncio.subprocess.DEVNULL,
stderr=asyncio.subprocess.PIPE stderr=asyncio.subprocess.PIPE
) )
stderr = await proc.communicate()[1] _, stderr = await proc.communicate()
await proc.wait()
if proc.returncode != 0: if proc.returncode != 0:
error_msg = stderr.decode() if stderr else "Unknown error" error_msg = stderr.decode() if stderr else "Unknown error"
@ -243,8 +242,7 @@ class WiFiMonitor:
stdout=asyncio.subprocess.DEVNULL, stdout=asyncio.subprocess.DEVNULL,
stderr=asyncio.subprocess.PIPE stderr=asyncio.subprocess.PIPE
) )
stderr = await proc.communicate()[1] _, stderr = await proc.communicate()
await proc.wait()
if proc.returncode != 0: if proc.returncode != 0:
error_msg = stderr.decode() if stderr else "Unknown error" error_msg = stderr.decode() if stderr else "Unknown error"
@ -267,8 +265,7 @@ class WiFiMonitor:
stdout=asyncio.subprocess.DEVNULL, stdout=asyncio.subprocess.DEVNULL,
stderr=asyncio.subprocess.PIPE stderr=asyncio.subprocess.PIPE
) )
stderr = await proc.communicate()[1] _, stderr = await proc.communicate()
await proc.wait()
if proc.returncode == 0: if proc.returncode == 0:
print(f"Channel set to {self.channel}") print(f"Channel set to {self.channel}")