Skip to content

Commit 5e1d4aa

Browse files
committed
Simplify implementation
1 parent b19e6a0 commit 5e1d4aa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Lib/pathlib.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
from operator import attrgetter
2020
from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO
2121
from urllib.parse import quote_from_bytes as urlquote_from_bytes
22-
try:
23-
from nt import _getfullpathname
24-
except ImportError:
25-
_getfullpathname = None
2622

2723

2824
__all__ = [
@@ -831,9 +827,9 @@ def absolute(self):
831827
"""
832828
if self.is_absolute():
833829
return self
834-
elif self._drv and _getfullpathname:
830+
elif self._drv:
835831
# There is a CWD on each drive-letter drive.
836-
cwd = _getfullpathname(self._drv)
832+
cwd = self._flavour.abspath(self._drv)
837833
else:
838834
cwd = os.getcwd()
839835
return self._from_parts([cwd] + self._parts)

0 commit comments

Comments
 (0)