From bc89e7eedc9039d70c6415aa581c05385fc5ee38 Mon Sep 17 00:00:00 2001 From: mfranke Date: Wed, 9 Dec 2015 22:25:59 +0100 Subject: [PATCH] compatibility fix for python 2.6.9 --- moto/elb/responses.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/moto/elb/responses.py b/moto/elb/responses.py index 3455ef38e..6f1c4a8c6 100644 --- a/moto/elb/responses.py +++ b/moto/elb/responses.py @@ -15,8 +15,6 @@ from .models import elb_backends from .exceptions import DuplicateTagKeysError, LoadBalancerNotFoundError, \ TooManyTagsError -from collections import Counter - class ELBResponse(BaseResponse): @@ -243,7 +241,8 @@ class ELBResponse(BaseResponse): elif t_key.split('.')[3] == 'Value': tag_values.extend(t_val) - counts = Counter(tag_keys).most_common(1) + counts = sorted({i:tag_keys.count(i) for i in tag_keys}.items(), + key=lambda i:i[1], reverse=True) if counts and counts[0][1] > 1: # We have dupes...