Skip to content
Merged
Prev Previous commit
Next Next commit
Merge branch 'main' into gh-78079-win-device-path-roots
  • Loading branch information
barneygale committed Apr 3, 2023
commit f412f878c42a423f57064f8218927fb4b9c69c00
11 changes: 2 additions & 9 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,15 +715,8 @@ def __new__(cls, *args, **kwargs):
def _make_child_relpath(self, part):
# This is an optimization used for dir walking. `part` must be
# a single part relative to this path.
drv = self._drv
root = self._root
parts = self._parts
if drv and not root and not parts:
sep = self._flavour.sep
if drv.startswith(sep) and not drv.endswith(sep):
# Incomplete UNC drive like '//foo'.
return self._from_parts([self, part])
return self._from_parsed_parts(drv, root, parts + [part])
parts = self._parts + [part]
return self._from_parsed_parts(self.drive, self.root, parts)

def __enter__(self):
# In previous versions of pathlib, __exit__() marked this path as
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.