Skip to content

Commit

Permalink
Fix root algorithm that resulted in infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Jul 15, 2024
1 parent 7134ea3 commit 591677d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yggdrasil/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2383,12 +2383,14 @@ def root(self):
out = None
logger.info(f"Looking for root:\n{pprint.pformat(self.products)}")
for k in self.products:
if platform._is_win and '/' in k:
k = k.replace('/', os.path.sep)
if not (k and os.path.isabs(k)):
continue
if out is None:
out = k
continue
while not k.startswith(out):
while out and not k.startswith(out):
out = os.path.dirname(out)
return out

Expand Down

0 comments on commit 591677d

Please sign in to comment.