fix: do not use bare 'except'

This commit is contained in:
Inex Code 2024-07-15 17:05:38 +04:00
parent 5c5e098bab
commit d8fe54e0e9

View file

@ -1,4 +1,4 @@
from typing import AsyncGenerator, List from typing import AsyncGenerator
from systemd import journal from systemd import journal
import asyncio import asyncio
@ -25,7 +25,7 @@ async def log_stream() -> AsyncGenerator[LogEntry, None]:
entry = await queue.get() entry = await queue.get()
try: try:
yield LogEntry(entry) yield LogEntry(entry)
except: except Exception:
asyncio.get_event_loop().remove_reader(j) asyncio.get_event_loop().remove_reader(j)
return return
queue.task_done() queue.task_done()