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) entry = self.create_task(coro)
crashed = False self.run()
try: self._join(entry)
self.run()
except BaseException as exc:
entry.exc = exc
crashed = True
if crashed:
raise entry.exc
return entry return entry
def reschedule_parent(self, coro): def reschedule_parent(self, coro):

View File

@ -27,6 +27,7 @@ async def main():
await giambio.sleep(2) await giambio.sleep(2)
print("Slept 2 seconds, killing countup") print("Slept 2 seconds, killing countup")
await cup.cancel() await cup.cancel()
# raise TypeError("bruh")
print("Countup cancelled") print("Countup cancelled")
up = await cup.join() up = await cup.join()
down = await cdown.join() down = await cdown.join()
@ -36,4 +37,7 @@ async def main():
if __name__ == "__main__": if __name__ == "__main__":
scheduler = giambio.AsyncScheduler() scheduler = giambio.AsyncScheduler()
scheduler.start(main()) try:
scheduler.start(main())
except Exception:
print("bruh")