summaryrefslogtreecommitdiffstats
path: root/Lib/pathlib/_abc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pathlib/_abc.py')
-rw-r--r--Lib/pathlib/_abc.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/pathlib/_abc.py b/Lib/pathlib/_abc.py
index caa84fc..c16beca 100644
--- a/Lib/pathlib/_abc.py
+++ b/Lib/pathlib/_abc.py
@@ -381,10 +381,10 @@ class PurePathBase:
def parts(self):
"""An object providing sequence-like access to the
components in the filesystem path."""
- if self.drive or self.root:
- return (self.drive + self.root,) + tuple(self._tail)
- else:
- return tuple(self._tail)
+ anchor, parts = self._stack
+ if anchor:
+ parts.append(anchor)
+ return tuple(reversed(parts))
def joinpath(self, *pathsegments):
"""Combine this path with one or several arguments, and return a