details:   https://code.tryton.org/tryton/commit/dcc2939f0c48
branch:    7.8
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
        (grafted from 261e0c174ddf435fda240d13ae518cc961a47e8a)
diffstat:

 trytond/trytond/application.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r c8bb26f0aba1 -r dcc2939f0c48 trytond/trytond/application.py
--- a/trytond/trytond/application.py    Mon Oct 05 18:21:13 2026 +0200
+++ b/trytond/trytond/application.py    Wed Sep 23 10:50:27 2026 +0200
@@ -41,4 +41,7 @@
     for thread in threads:
         thread.join()
 
-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")

Reply via email to