Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def cwd(cls):
"""Return a new path pointing to the current working directory
(as returned by os.getcwd()).
"""
return cls(os.getcwd())
return cls().absolute()

@classmethod
def home(cls):
Expand Down Expand Up @@ -825,7 +825,7 @@ def absolute(self):
"""
if self.is_absolute():
return self
return self._from_parts([self.cwd()] + self._parts)
return self._from_parts([os.getcwd()] + self._parts)

def resolve(self, strict=False):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve performance of :meth:`pathlib.Path.absolute`.