Skip to content

Commit 25752d2

Browse files
authored
Avoid miscalculating PurePath.parts for short paths (#341)
1 parent 867d099 commit 25752d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/manage/pathutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def parts(self):
8383
while ".." in bits:
8484
i = bits.index("..")
8585
bits.pop(i)
86-
bits.pop(i - 1)
86+
if i >= 1:
87+
bits.pop(i - 1)
8788
return bits
8889

8990
def __truediv__(self, other):

0 commit comments

Comments
 (0)