Skip to content

Commit

Permalink
fix: change condition for breaking loop, as previous version could le…
Browse files Browse the repository at this point in the history
…ad to infinite loop
  • Loading branch information
[email protected] authored and Tobias Klare committed Nov 22, 2019
1 parent 22a631d commit b3ca03d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions poetry/masonry/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ def find_excluded_files(self): # type: () -> Set[str]
def is_excluded(self, filepath): # type: (Union[str, Path]) -> bool
exclude_path = Path(filepath)

while exclude_path.as_posix() not in (".", "/"):
while True:
if exclude_path.as_posix() in self.find_excluded_files():
return True
else:

if len(exclude_path.parts) > 1:
exclude_path = exclude_path.parent
else:
break

return False

Expand Down

0 comments on commit b3ca03d

Please sign in to comment.