Skip to content

Commit

Permalink
Undo resolve() changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Jan 6, 2024
1 parent 324046e commit 1545411
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions Lib/pathlib/_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,17 +931,9 @@ def _split_stack(self):
uppermost parent of the path (equivalent to path.parents[-1]), and
*parts* is a reversed list of parts following the anchor.
"""
split = self.pathmod.split
path = str(self)
parent, name = split(path)
names = []
while path != parent:
names.append(name)
path = parent
parent, name = split(path)
if not names:
if not self._tail:
return self, []
return self.with_segments(path), names
return self._from_parsed_parts(self.drive, self.root, []), self._tail[::-1]

def resolve(self, strict=False):
"""
Expand All @@ -962,9 +954,7 @@ def resolve(self, strict=False):
link_count = 0
while parts:
part = parts.pop()
if not part or part == '.':
continue
elif part == '..':
if part == '..':
if not path._tail:
if path.root:
# Delete '..' segment immediately following root
Expand Down

0 comments on commit 1545411

Please sign in to comment.