From 598b6d00f07fc8880e44ef7d9e1e7aea327c317b Mon Sep 17 00:00:00 2001 From: malletvapid23 Date: Fri, 20 Nov 2020 07:18:22 -0800 Subject: [PATCH] [acl-loader] Make list sorting compliant with Python 3 (#1257) In Python 3, sort() takes no positional arguments, only keyword arguments. Fix acl-loader to comply. Fixes vsimage build failure in Azure/sonic-buildimage#5926 --- acl_loader/main.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/acl_loader/main.py b/acl_loader/main.py index 921718f..667e449 100644 --- a/acl_loader/main.py +++ b/acl_loader/main.py @@ -826,11 +826,7 @@ def pop_matches(val): raw_data.append([priority, rule_data]) - def cmp_rules(a, b): - return cmp(a[0], b[0]) - - raw_data.sort(cmp_rules) - raw_data.reverse() + raw_data.sort(key=lambda x: x[0], reverse=True) data = [] for _, d in raw_data: