diff --git a/giambio/_core.py b/giambio/_core.py index f2591b2..746179e 100644 --- a/giambio/_core.py +++ b/giambio/_core.py @@ -171,14 +171,8 @@ class AsyncScheduler: """ entry = self.create_task(coro) - crashed = False - try: - self.run() - except BaseException as exc: - entry.exc = exc - crashed = True - if crashed: - raise entry.exc + self.run() + self._join(entry) return entry def reschedule_parent(self, coro): diff --git a/tests/count.py b/tests/count.py index 583d336..00e4e93 100644 --- a/tests/count.py +++ b/tests/count.py @@ -27,6 +27,7 @@ async def main(): await giambio.sleep(2) print("Slept 2 seconds, killing countup") await cup.cancel() +# raise TypeError("bruh") print("Countup cancelled") up = await cup.join() down = await cdown.join() @@ -36,4 +37,7 @@ async def main(): if __name__ == "__main__": scheduler = giambio.AsyncScheduler() - scheduler.start(main()) + try: + scheduler.start(main()) + except Exception: + print("bruh")