From 0b3ea57e616f37edaaf131c08a23a34cf715c1d6 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 11 Apr 2017 17:15:01 +0200 Subject: [PATCH] [#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) --- addons/payment_buckaroo/models/payment.py | 2 +- odoo/addons/base/res/res_users.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/payment_buckaroo/models/payment.py b/addons/payment_buckaroo/models/payment.py index 05e0c314921..2235226769f 100644 --- a/addons/payment_buckaroo/models/payment.py +++ b/addons/payment_buckaroo/models/payment.py @@ -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) diff --git a/odoo/addons/base/res/res_users.py b/odoo/addons/base/res/res_users.py index 978fb6f4024..db1e17863d2 100644 --- a/odoo/addons/base/res/res_users.py +++ b/odoo/addons/base/res/res_users.py @@ -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))