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}")