Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Commit 2e0b19d

Browse files
committed
Merge pull request gvalkov#53 from paulo-raca/read_loop
async version of `read_loop()` must stop on errors.
2 parents af11cb2 + 7e35375 commit 2e0b19d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

evdev/eventio_async.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ def __anext__(self):
7676
future.set_result(next(self.current_batch))
7777
except StopIteration:
7878
def next_batch_ready(batch):
79-
self.current_batch = batch.result()
80-
future.set_result(next(self.current_batch))
79+
try:
80+
self.current_batch = batch.result()
81+
future.set_result(next(self.current_batch))
82+
except Exception as e:
83+
future.set_exception(e)
8184
self.device.async_read().add_done_callback(next_batch_ready)
8285
return future

0 commit comments

Comments
 (0)