Skip to content

Commit 39bcfce

Browse files
committed
Pass arguments to closure instead of late binding
1 parent 35ec437 commit 39bcfce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pip/_internal/req/req_uninstall.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,17 @@ def from_dist(cls, dist: BaseDistribution) -> "UninstallPathSet":
559559
pass
560560

561561
# find console_scripts and gui_scripts
562-
def iter_scripts_to_remove() -> Iterator[str]:
562+
def iter_scripts_to_remove(
563+
dist: BaseDistribution,
564+
bin_dir: str,
565+
) -> Iterator[str]:
563566
for entry_point in dist.iter_entry_points():
564567
if entry_point.group == "console_scripts":
565568
yield from _script_names(bin_dir, entry_point.name, False)
566569
elif entry_point.group == "gui_scripts":
567570
yield from _script_names(bin_dir, entry_point.name, True)
568571

569-
for s in iter_scripts_to_remove():
572+
for s in iter_scripts_to_remove(dist, bin_dir):
570573
paths_to_remove.add(s)
571574

572575
return paths_to_remove

0 commit comments

Comments
 (0)