@@ -187,7 +187,7 @@ def compile_pattern(self, pattern):
187
187
def resolve (self , path , strict = False ):
188
188
s = str (path )
189
189
if not s :
190
- return os .getcwd ()
190
+ return path . _accessor .getcwd ()
191
191
previous_s = None
192
192
if _getfinalpathname is not None :
193
193
if strict :
@@ -352,7 +352,7 @@ def _resolve(path, rest):
352
352
return path
353
353
# NOTE: according to POSIX, getcwd() cannot contain path components
354
354
# which are symlinks.
355
- base = '' if path .is_absolute () else os .getcwd ()
355
+ base = '' if path .is_absolute () else accessor .getcwd ()
356
356
return _resolve (base , str (path )) or sep
357
357
358
358
def is_reserved (self , parts ):
@@ -469,6 +469,8 @@ def group(self, path):
469
469
except ImportError :
470
470
raise NotImplementedError ("Path.group() is unsupported on this system" )
471
471
472
+ getcwd = os .getcwd
473
+
472
474
473
475
_normal_accessor = _NormalAccessor ()
474
476
@@ -1104,7 +1106,7 @@ def cwd(cls):
1104
1106
"""Return a new path pointing to the current working directory
1105
1107
(as returned by os.getcwd()).
1106
1108
"""
1107
- return cls (os .getcwd ())
1109
+ return cls (cls (). _accessor .getcwd ())
1108
1110
1109
1111
@classmethod
1110
1112
def home (cls ):
@@ -1173,7 +1175,7 @@ def absolute(self):
1173
1175
return self
1174
1176
# FIXME this must defer to the specific flavour (and, under Windows,
1175
1177
# use nt._getfullpathname())
1176
- return self ._from_parts ([os .getcwd ()] + self ._parts )
1178
+ return self ._from_parts ([self . _accessor .getcwd ()] + self ._parts )
1177
1179
1178
1180
def resolve (self , strict = False ):
1179
1181
"""
0 commit comments