Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 2e5ad18

Browse files
committed
better script init
1 parent 5d092ff commit 2e5ad18

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/patches/recalculate_all_first_place_scores.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
from __future__ import annotations
44

55
import asyncio
6+
import atexit
67
import logging
78
import os
89
import sys
910

1011
sys.path.insert(1, os.path.join(sys.path[0], "../.."))
1112

1213
import lifecycle
14+
from common import exception_handling
15+
from common.log import logging_config
1316
from common.ripple import user_utils
1417
from objects import glob
1518

@@ -25,4 +28,11 @@ async def main() -> int:
2528

2629

2730
if __name__ == "__main__":
28-
exit(asyncio.run(main()))
31+
logging_config.configure_logging()
32+
exception_handling.hook_exception_handlers()
33+
atexit.register(exception_handling.unhook_exception_handlers)
34+
try:
35+
exit_code = asyncio.run(main())
36+
except KeyboardInterrupt:
37+
exit_code = 0
38+
exit(exit_code)

0 commit comments

Comments
 (0)