summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python/sort.py
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-03-11 10:39:13 +0100
committerAndrew Bartlett <abartlet@samba.org>2016-03-11 22:58:18 +0100
commit7b4ad69b59e8951b90545dd02befa579e90f8582 (patch)
tree5492c4409b6fc7848fb6208ce0a1ec11d9f40f93 /source4/dsdb/tests/python/sort.py
parent1a315bec2720aafc9f0efa48eb36509fc26a6ebf (diff)
downloadsamba-7b4ad69b59e8951b90545dd02befa579e90f8582.tar.gz
samba-7b4ad69b59e8951b90545dd02befa579e90f8582.tar.bz2
samba-7b4ad69b59e8951b90545dd02befa579e90f8582.zip
s4:dsdb/test/sort: avoid 'from collections import Counter'
This is only available in python 2.7 and >= 3.1 This should fix make test with python 2.6. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/tests/python/sort.py')
-rw-r--r--source4/dsdb/tests/python/sort.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/dsdb/tests/python/sort.py b/source4/dsdb/tests/python/sort.py
index c4d2c445268..b7b9d836e8f 100644
--- a/source4/dsdb/tests/python/sort.py
+++ b/source4/dsdb/tests/python/sort.py
@@ -5,7 +5,6 @@ from unicodedata import normalize
import locale
locale.setlocale(locale.LC_ALL, ('en_US', 'UTF-8'))
-from collections import Counter
import optparse
import sys
import os
@@ -191,7 +190,13 @@ class BaseSortTests(samba.tests.TestCase):
self.expected_results[k] = (fixed, list(reversed(fixed)))
for k in ('streetAddress', 'postalAddress'):
if k in self.expected_results:
- c = Counter([u[k] for u in self.users])
+ c = {}
+ for u in self.users:
+ x = u[k]
+ if x in c:
+ c[x] += 1
+ continue
+ c[x] = 1
fixed = []
for x in FIENDISH_TESTS:
fixed += [norm(x)] * c[x]