Skip to content

Commit 2b6b368

Browse files
authored
Merge pull request #2989 from nipy/maint/oesteban-patch-1
ENH: Let ``indirectory`` handle ``nipype.utils.filemanip.Path``
2 parents 01a2772 + 55be540 commit 2b6b368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nipype/utils/filemanip.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def loadpkl(infile, versioning=False):
682682
pklopen = gzip.open if infile.suffix == '.pklz' else open
683683
pkl_metadata = None
684684

685-
with indirectory(str(infile.parent)):
685+
with indirectory(infile.parent):
686686
pkl_file = pklopen(infile.name, 'rb')
687687

688688
try: # Look if pkl file contains version file
@@ -1039,7 +1039,7 @@ def relpath(path, start=None):
10391039
@contextlib.contextmanager
10401040
def indirectory(path):
10411041
cwd = os.getcwd()
1042-
os.chdir(path)
1042+
os.chdir(str(path))
10431043
try:
10441044
yield
10451045
finally:

0 commit comments

Comments
 (0)