File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -636,7 +636,8 @@ def _read_files_egginfo_installed(self):
636636 return
637637
638638 paths = (
639- py311 .relative_fix ((subdir / name ).resolve ())
639+ py311
640+ .relative_fix ((subdir / name ).resolve ())
640641 .relative_to (self .locate_file ('' ).resolve (), walk_up = True )
641642 .as_posix ()
642643 for name in text .splitlines ()
@@ -928,10 +929,12 @@ def __init__(self, name: str | None):
928929 def normalize (name ):
929930 """
930931 PEP 503 normalization plus dashes as underscores.
932+
933+ Specifically avoids ``re.sub`` as prescribed for performance
934+ benefits (see python/cpython#143658).
931935 """
932- # Much faster than re.sub, and even faster than str.translate
933936 value = name .lower ().replace ("-" , "_" ).replace ("." , "_" )
934- # Condense repeats (faster than regex)
937+ # Condense repeats
935938 while "__" in value :
936939 value = value .replace ("__" , "_" )
937940 return value
You can’t perform that action at this time.
0 commit comments