From 0d1d6e1ee0cfea502b1992ee81b08eb1b504f18e Mon Sep 17 00:00:00 2001 From: Joe LeVeque 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 921718f585..667e4497f8 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: