Skip to content

Commit 1fc08ac

Browse files
core: libs: commonwealth: Hotspot: Use asyncio.sleep over time.sleep for async function
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent 36f309f commit 1fc08ac

File tree

1 file changed

+2
-1
lines changed
  • core/services/wifi/wifi_handlers/wpa_supplicant

1 file changed

+2
-1
lines changed

core/services/wifi/wifi_handlers/wpa_supplicant/Hotspot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import hashlib
23
import pathlib
34
import shlex
@@ -173,7 +174,7 @@ def start(self) -> None:
173174
# pylint: disable=consider-using-with
174175
if not self.is_running():
175176
self._subprocess = subprocess.Popen(self.command_list(), shell=False, encoding="utf-8", errors="ignore")
176-
time.sleep(3)
177+
await asyncio.sleep(3)
177178
if not self.is_running():
178179
exit_code = self._subprocess.returncode
179180
raise RuntimeError(f"Failed to initialize Hostapd ({exit_code}).")

0 commit comments

Comments
 (0)