mirror of https://github.com/nocturn9x/giambio.git
More polishing
This commit is contained in:
parent
daf727d67d
commit
3745886500
|
@ -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):
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue