Skip to content

Commit

Permalink
fix: read ret when no exception
Browse files Browse the repository at this point in the history
  • Loading branch information
eri24816 committed Apr 23, 2024
1 parent b00e936 commit ad077ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/src/grapycal/core/background_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ def run(self):
ret = task()
except Exception as e:
on_exception(e, exception_callback)
# if ret is a generator, push it to stack
if isinstance(ret, Iterator):
self._stack.append(TaskInfo(iter(ret), exception_callback))
else:
# if ret is a generator, push it to stack
if isinstance(ret, Iterator):
self._stack.append(TaskInfo(iter(ret), exception_callback))

except RunnerInterrupt:
logger.info("Runner interrupted")
Expand Down

0 comments on commit ad077ad

Please sign in to comment.