File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -165,17 +165,6 @@ def __missing__(self, node_class):
165165 return fields
166166
167167
168- def counter (items ):
169- """
170- Simplest required implementation of collections.Counter. Required as 2.6
171- does not have Counter in collections.
172- """
173- results = {}
174- for item in items :
175- results [item ] = results .get (item , 0 ) + 1
176- return results
177-
178-
179168def iter_child_nodes (node , omit = None , _fields_order = _FieldsOrder ()):
180169 """
181170 Yield all direct child nodes of *node*, that is, all fields that
@@ -1777,7 +1766,7 @@ def DICT(self, node):
17771766 convert_to_value (key ) for key in node .keys
17781767 ]
17791768
1780- key_counts = counter (keys )
1769+ key_counts = collections . Counter (keys )
17811770 duplicate_keys = [
17821771 key for key , count in key_counts .items ()
17831772 if count > 1
@@ -1786,7 +1775,7 @@ def DICT(self, node):
17861775 for key in duplicate_keys :
17871776 key_indices = [i for i , i_key in enumerate (keys ) if i_key == key ]
17881777
1789- values = counter (
1778+ values = collections . Counter (
17901779 convert_to_value (node .values [index ])
17911780 for index in key_indices
17921781 )
You can’t perform that action at this time.
0 commit comments