Skip to content

Iterates through each path from self._clean_trees to improve error ha… #58263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@ def initialize_options(self) -> None:
".orig",
):
self._clean_me.append(filepath)
self._clean_trees.append(pjoin(root, d) for d in dirs if d == "__pycache__")

# Extend self._clean_trees with list comprehension (convert generator to list)
self._clean_trees.extend([os.path.join(root, dir) for dir in dirs if dir == "__pycache__"])

# clean the generated pxi files
for pxifile in _pxifiles:
pxifile_replaced = pxifile.replace(".pxi.in", ".pxi")
self._clean_me.append(pxifile_replaced)

self._clean_trees.append(d for d in ("build", "dist") if os.path.exists(d))
self._clean_trees.extend([os.path.join(os.getcwd(), dir) for dir in ("build", "dist") if os.path.exists(dir)])


def finalize_options(self) -> None:
pass
Expand Down
Loading