test-pathencode: make a 2.4-safe import of collections
authorBryan O'Sullivan <bryano@fb.com>
Thu, 15 Nov 2012 10:55:32 -0800
changeset 17935 9c888b945b65
parent 17934 736f1c09f321
child 17936 95fc4ab324df
child 17939 d587925680d9
test-pathencode: make a 2.4-safe import of collections
tests/test-pathencode.py
--- a/tests/test-pathencode.py	Thu Nov 15 10:04:29 2012 -0800
+++ b/tests/test-pathencode.py	Thu Nov 15 10:55:32 2012 -0800
@@ -8,7 +8,7 @@
 from mercurial import parsers
 from mercurial import store
 import binascii, itertools, math, os, random, sys, time
-from collections import defaultdict
+import collections
 
 def hybridencode(path):
     return store._hybridencode(path, True)
@@ -41,7 +41,7 @@
     '''Construct and print a table of probabilities for path name
     components.  The numbers are percentages.'''
 
-    counts = defaultdict(lambda: 0)
+    counts = collections.defaultdict(lambda: 0)
     for line in os.popen(cmd).read().splitlines():
         if line[-2:] in ('.i', '.d'):
             line = line[:-2]