changeset 677c4fc1c843 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=677c4fc1c843
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
diffstat:

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

diffs (17 lines):

diff -r c4ec4f7d9866 -r 677c4fc1c843 trytond/transaction.py
--- a/trytond/transaction.py    Tue Jan 15 11:30:20 2019 +0100
+++ b/trytond/transaction.py    Thu Jan 17 17:13:26 2019 +0100
@@ -152,8 +152,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