summaryrefslogtreecommitdiffstats
path: root/Lib/pathlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r--Lib/pathlib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index c608ba0..26da4ed 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -443,6 +443,8 @@ class _PathParents(Sequence):
if idx >= len(self) or idx < -len(self):
raise IndexError(idx)
+ if idx < 0:
+ idx += len(self)
return self._pathcls._from_parsed_parts(self._drv, self._root,
self._parts[:-idx - 1])