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)
|
entry = self.create_task(coro)
|
||||||
crashed = False
|
|
||||||
try:
|
|
||||||
self.run()
|
self.run()
|
||||||
except BaseException as exc:
|
self._join(entry)
|
||||||
entry.exc = exc
|
|
||||||
crashed = True
|
|
||||||
if crashed:
|
|
||||||
raise entry.exc
|
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
def reschedule_parent(self, coro):
|
def reschedule_parent(self, coro):
|
||||||
|
|
|
@ -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()
|
||||||
|
try:
|
||||||
scheduler.start(main())
|
scheduler.start(main())
|
||||||
|
except Exception:
|
||||||
|
print("bruh")
|
||||||
|
|
Loading…
Reference in New Issue