changeset 2b5938e1dffc in tryton:4.6
details: https://hg.tryton.org/tryton?cmd=changeset;node=2b5938e1dffc
description:
        Do not override exception variable in "except as"

        The variable is removed outside the except block.

        issue8172
        review46811002
        (grafted from 7c78f9ebbb3725001fd8fa63b077cff1bffb3c5c)
diffstat:

 tryton/gui/window/view_form/model/record.py |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 68b1c94697e9 -r 2b5938e1dffc tryton/gui/window/view_form/model/record.py
--- a/tryton/gui/window/view_form/model/record.py       Fri Mar 08 18:39:27 
2019 +0100
+++ b/tryton/gui/window/view_form/model/record.py       Fri Mar 15 11:15:41 
2019 +0100
@@ -112,20 +112,20 @@
             ctx.update(dict(('%s.%s' % (self.model_name, fname), 'size')
                     for fname, field in self.group.fields.iteritems()
                     if field.attrs['type'] == 'binary' and fname in fnames))
-            exception = None
+            exception = False
             try:
                 values = RPCExecute('model', self.model_name, 'read',
                     id2record.keys(), fnames, context=ctx)
-            except RPCException, exception:
+            except RPCException:
                 values = [{'id': x} for x in id2record]
                 default_values = dict((f, None) for f in fnames)
                 for value in values:
                     value.update(default_values)
-                self.exception = True
+                self.exception = exception = True
             id2value = dict((value['id'], value) for value in values)
             for id, record in id2record.iteritems():
                 if not record.exception:
-                    record.exception = bool(exception)
+                    record.exception = exception
                 value = id2value.get(id)
                 if record and not record.destroyed and value:
                     for key in record.modified_fields:

Reply via email to