[#8530] remove uses of tuple parameter unpacking

While sometimes convenient, the ability to unpack tuple parameters (to
lambdas and functions) was removed from Python 3. Either use the tuple
directly or unpack it in the function body.

(lib2to3.fixes.fix_tuple_params)
This commit is contained in:
Xavier Morel
2017-04-11 17:15:01 +02:00
parent 578b0ef2fd
commit 0b3ea57e61
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class AcquirerBuckaroo(models.Model):
del values[key]
break
items = sorted(values.items(), key=lambda (x, y): x.lower())
items = sorted(values.items(), key=lambda pair: pair[0].lower())
sign = ''.join('%s=%s' % (k, urllib.unquote_plus(v)) for k, v in items)
else:
sign = ''.join('%s=%s' % (k, get_value(k)) for k in keys)
+1 -1
View File
@@ -780,7 +780,7 @@ class GroupsView(models.Model):
others += g
# build the result
res = []
for app, gs in sorted(by_app.iteritems(), key=lambda (a, _): a.sequence or 0):
for app, gs in sorted(by_app.iteritems(), key=lambda it: it[0].sequence or 0):
res.append(linearize(app, gs))
if others:
res.append((self.env['ir.module.category'], 'boolean', others))