Skip to content

Commit

Permalink
Fix WindowsPath('C:').absolute()
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Dec 4, 2023
1 parent d4c87c6 commit 1a77c8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,8 @@ def absolute(self):
elif self.drive:
# There is a CWD on each drive-letter drive.
cwd = os.path.abspath(self.drive)
if not self._tail:
return self.with_segments(cwd)
else:
cwd = os.getcwd()
# Fast path for "empty" paths, e.g. Path("."), Path("") or Path().
Expand Down

0 comments on commit 1a77c8a

Please sign in to comment.