Skip to content

Commit 2271a4e

Browse files
committed
Stop handling ValueError and OSError from _getfullpathname()
1 parent d2649a6 commit 2271a4e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Lib/pathlib.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,8 @@ def absolute(self):
832832
if self.is_absolute():
833833
return self
834834
elif self._drv and _getfullpathname:
835-
try:
836-
cwd = _getfullpathname(self._drv)
837-
except (ValueError, OSError):
838-
cwd = os.getcwd()
835+
# There is a CWD on each drive-letter drive.
836+
cwd = _getfullpathname(self._drv)
839837
else:
840838
cwd = os.getcwd()
841839
return self._from_parts([cwd] + self._parts)

0 commit comments

Comments
 (0)