More polishing

This commit is contained in:
nocturn9x 2020-11-12 23:35:01 +01:00
parent daf727d67d
commit 3745886500
2 changed files with 7 additions and 9 deletions

View File

@ -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):

View File

@ -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")