File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -470,14 +470,11 @@ def is_egg(self, search):
470470 and base .endswith ('.egg' ))
471471
472472 def search (self , name ):
473- for child in self .children ():
474- n_low = child .lower ()
475- if (n_low in name .exact_matches
476- or n_low .replace ('.' , '_' ).startswith (name .prefix )
477- and n_low .endswith (name .suffixes )
478- # legacy case:
479- or self .is_egg (name ) and n_low == 'egg-info' ):
480- yield self .joinpath (child )
473+ return (
474+ self .joinpath (child )
475+ for child in self .children ()
476+ if name .matches (child , self )
477+ )
481478
482479
483480class Prepared :
@@ -507,6 +504,16 @@ def normalize(name):
507504 """
508505 return re .sub (r"[-_.]+" , "-" , name ).lower ().replace ('-' , '_' )
509506
507+ def matches (self , name , path ):
508+ n_low = name .lower ()
509+ return (
510+ n_low in self .exact_matches
511+ or n_low .replace ('.' , '_' ).startswith (self .prefix )
512+ and n_low .endswith (self .suffixes )
513+ # legacy case:
514+ or path .is_egg (self ) and n_low == 'egg-info'
515+ )
516+
510517
511518@install
512519class MetadataPathFinder (NullFinder , DistributionFinder ):
You can’t perform that action at this time.
0 commit comments