fix communicate and await
This commit is contained in:
parent
e09456aab9
commit
96aab517af
|
|
@ -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}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue