details: https://code.tryton.org/tryton/commit/261e0c174ddf
branch: default
user: Nicolas Évrard <[email protected]>
date: Wed Sep 23 10:50:27 2026 +0200
description:
Turn the assert on the threads after Pool initialization into an
exception
People running with PYTHONOPTIMIZE set deserve to know that something
is going
wrong
diffstat:
trytond/trytond/application.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 69857991edf1 -r 261e0c174ddf trytond/trytond/application.py
--- a/trytond/trytond/application.py Wed Sep 23 10:41:33 2026 +0200
+++ b/trytond/trytond/application.py Wed Sep 23 10:50:27 2026 +0200
@@ -39,4 +39,7 @@
Pool(name).init()
backend.Database(name).close()
-assert len(threads := threading.enumerate()) == 1, f"len({threads}) != 1"
+if len(threads := threading.enumerate()) != 1:
+ raise RuntimeError(
+ f"There are {len(threads)} threads running after initializing"
+ " the Pool")