Skip to content

Commit d995008

Browse files
committed
Fix com0com coroutine closing to early
for #49, missing await
1 parent 210e97f commit d995008

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ble_serial/ports/windows_com0com.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async def run_loop(self):
2525
pool = ThreadPoolExecutor(max_workers=2)
2626
rx = self.loop.run_in_executor(pool, self._run_rx)
2727
tx = self.loop.run_in_executor(pool, self._run_tx)
28-
return asyncio.gather(rx, tx)
28+
await asyncio.gather(rx, tx)
2929

3030
def _run_tx(self):
3131
while self.alive and self.serial.is_open:
@@ -57,4 +57,5 @@ def stop_loop(self):
5757
def remove(self):
5858
if hasattr(self, 'serial'):
5959
self.serial.close()
60+
self.stop_loop()
6061

0 commit comments

Comments
 (0)