CI: add_version: correctly handle exceptions

exit code 1 is used as a signal that no new version is found -- so have to use a different exit code for unhandled exceptions
This commit is contained in:
Ivan Pozdeev committed 2026-05-08 17:48:39 +03:00
1 parent 40dba8256f
commit 97573e156e
2 files changed
+9

No files matched your search

@@ -30,6 +30,13 @@ import requests_html
import sortedcontainers
import tqdm
#CI uses exit code 1 as a signal that no new version is found
#so have to produce a different exit code on an exception
def _excepthook(type,value,traceback):
logging.error("Unhandled exception occured",exc_info=(type,value,traceback))
sys.exit(2)
sys.excepthook = _excepthook
logger = logging.getLogger(__name__)
CUTOFF_VERSION=packaging.version.Version('3.10')