@@ -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 ):
@@ -461,6 +461,8 @@ def group(self, path):
461
461
except ImportError :
462
462
raise NotImplementedError ("Path.group() is unsupported on this system" )
463
463
464
+ getcwd = os .getcwd
465
+
464
466
465
467
_normal_accessor = _NormalAccessor ()
466
468
@@ -1096,7 +1098,7 @@ def cwd(cls):
1096
1098
"""Return a new path pointing to the current working directory
1097
1099
(as returned by os.getcwd()).
1098
1100
"""
1099
- return cls (os .getcwd ())
1101
+ return cls (cls (). _accessor .getcwd ())
1100
1102
1101
1103
@classmethod
1102
1104
def home (cls ):
@@ -1165,7 +1167,7 @@ def absolute(self):
1165
1167
return self
1166
1168
# FIXME this must defer to the specific flavour (and, under Windows,
1167
1169
# use nt._getfullpathname())
1168
- return self ._from_parts ([os .getcwd ()] + self ._parts )
1170
+ return self ._from_parts ([self . _accessor .getcwd ()] + self ._parts )
1169
1171
1170
1172
def resolve (self , strict = False ):
1171
1173
"""
0 commit comments