From 96aab517af0c88a8e73c2187a58267dc03dec8ab Mon Sep 17 00:00:00 2001 From: Robert McMahon Date: Fri, 13 Feb 2026 15:34:47 -0800 Subject: [PATCH] fix communicate and await --- wifi_monitor.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wifi_monitor.py b/wifi_monitor.py index 7de9192..bed75e6 100755 --- a/wifi_monitor.py +++ b/wifi_monitor.py @@ -227,8 +227,7 @@ class WiFiMonitor: stdout=asyncio.subprocess.DEVNULL, stderr=asyncio.subprocess.PIPE ) - stderr = await proc.communicate()[1] - await proc.wait() + _, stderr = await proc.communicate() if proc.returncode != 0: error_msg = stderr.decode() if stderr else "Unknown error" @@ -243,8 +242,7 @@ class WiFiMonitor: stdout=asyncio.subprocess.DEVNULL, stderr=asyncio.subprocess.PIPE ) - stderr = await proc.communicate()[1] - await proc.wait() + _, stderr = await proc.communicate() if proc.returncode != 0: error_msg = stderr.decode() if stderr else "Unknown error" @@ -267,8 +265,7 @@ class WiFiMonitor: stdout=asyncio.subprocess.DEVNULL, stderr=asyncio.subprocess.PIPE ) - stderr = await proc.communicate()[1] - await proc.wait() + _, stderr = await proc.communicate() if proc.returncode == 0: print(f"Channel set to {self.channel}")