Subject: changeset in trytond:4.4 Remove actual stopped self from the 
transactions stack
From: Cédric Krier <[email protected]>

changeset fe396c8fee1c in trytond:4.4
details: https://hg.tryton.org/trytond?cmd=changeset;node=fe396c8fee1c
description:
        Remove actual stopped self from the transactions stack

        Stopping non-current transaction should not remove the last transaction 
but
        the last itself.

        issue7973
        review45861002
        (grafted from 677c4fc1c843232ab31a05b24ed8c1c17601ff78)
diffstat:

 trytond/transaction.py |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r 61e192d4fc0c -r fe396c8fee1c trytond/transaction.py
--- a/trytond/transaction.py    Tue Jan 15 00:02:19 2019 +0100
+++ b/trytond/transaction.py    Thu Jan 17 17:13:26 2019 +0100
@@ -145,8 +145,11 @@
                 for func, args, kwargs in self._atexit:
                     func(*args, **kwargs)
         finally:
-            current_instance = transactions.pop()
-        assert current_instance is self, transactions
+            transactions.reverse()
+            try:
+                transactions.remove(self)
+            finally:
+                transactions.reverse()
 
     def set_context(self, context=None, **kwargs):
         if context is None:

Reply via email to