Skip to content
Prev Previous commit
Next Next commit
Fix _format_parsed_parts()
  • Loading branch information
barneygale committed Mar 6, 2023
commit fe5cfb3c4bd04f2375742bc9d84933a902e2c732
5 changes: 3 additions & 2 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ def _from_parsed_parts(cls, drv, root, parts):
def _format_parsed_parts(cls, drv, root, parts):
if drv or root:
return drv + root + cls._flavour.sep.join(parts[1:])
else:
return cls._flavour.sep.join(parts)
elif parts and cls._flavour.splitdrive(parts[0])[0]:
Comment thread
barneygale marked this conversation as resolved.
parts = ['.'] + parts
return cls._flavour.sep.join(parts)

def __str__(self):
"""Return the string representation of the path, suitable for
Expand Down