@@ -462,18 +462,11 @@ def zip_children(self):
462
462
for child in names
463
463
)
464
464
465
- def is_egg (self , search ):
466
- base = self .base
467
- return (
468
- base == search .versionless_egg_name
469
- or base .startswith (search .prefix )
470
- and base .endswith ('.egg' ))
471
-
472
465
def search (self , name ):
473
466
return (
474
467
self .joinpath (child )
475
468
for child in self .children ()
476
- if name .matches (child , self )
469
+ if name .matches (child , self . base )
477
470
)
478
471
479
472
@@ -504,16 +497,22 @@ def normalize(name):
504
497
"""
505
498
return re .sub (r"[-_.]+" , "-" , name ).lower ().replace ('-' , '_' )
506
499
507
- def matches (self , name , path ):
500
+ def matches (self , name , base ):
508
501
n_low = name .lower ()
509
502
return (
510
503
n_low in self .exact_matches
511
504
or n_low .replace ('.' , '_' ).startswith (self .prefix )
512
505
and n_low .endswith (self .suffixes )
513
506
# legacy case:
514
- or path .is_egg (self ) and n_low == 'egg-info'
507
+ or self .is_egg (base ) and n_low == 'egg-info'
515
508
)
516
509
510
+ def is_egg (self , base ):
511
+ return (
512
+ base == self .versionless_egg_name
513
+ or base .startswith (self .prefix )
514
+ and base .endswith ('.egg' ))
515
+
517
516
518
517
@install
519
518
class MetadataPathFinder (NullFinder , DistributionFinder ):
0 commit comments