File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1414import contextlib
1515import collections
1616
17- from ._collections import freezable_defaultdict
17+ from ._collections import FreezableDefaultDict
1818from ._compat import (
1919 NullFinder ,
2020 Protocol ,
@@ -659,8 +659,8 @@ class Lookup:
659659 def __init__ (self , path : FastPath ):
660660 base = os .path .basename (path .root ).lower ()
661661 base_is_egg = base .endswith (".egg" )
662- self .infos = freezable_defaultdict (list )
663- self .eggs = freezable_defaultdict (list )
662+ self .infos = FreezableDefaultDict (list )
663+ self .eggs = FreezableDefaultDict (list )
664664
665665 for child in path .children ():
666666 low = child .lower ()
Original file line number Diff line number Diff line change 11import collections
22
33
4- class freezable_defaultdict (collections .defaultdict ):
4+ # from jaraco.collections 3.3
5+ class FreezableDefaultDict (collections .defaultdict ):
56 """
6- Mix-in to freeze a defaultdict.
7+ Often it is desirable to prevent the mutation of
8+ a default dict after its initial construction, such
9+ as to prevent mutation during iteration.
710
8- >>> dd = freezable_defaultdict (list)
11+ >>> dd = FreezableDefaultDict (list)
912 >>> dd[0].append('1')
1013 >>> dd.freeze()
1114 >>> dd[1]
You can’t perform that action at this time.
0 commit comments