Skip to content

Commit

Permalink
ENH: Let indirectory handle nipype.utils.filemanip.Path
Browse files Browse the repository at this point in the history
Addresses #2985 (comment)
  • Loading branch information
oesteban authored Aug 6, 2019
1 parent 01a2772 commit 55be540
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def loadpkl(infile, versioning=False):
pklopen = gzip.open if infile.suffix == '.pklz' else open
pkl_metadata = None

with indirectory(str(infile.parent)):
with indirectory(infile.parent):
pkl_file = pklopen(infile.name, 'rb')

try: # Look if pkl file contains version file
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def relpath(path, start=None):
@contextlib.contextmanager
def indirectory(path):
cwd = os.getcwd()
os.chdir(path)
os.chdir(str(path))
try:
yield
finally:
Expand Down

0 comments on commit 55be540

Please sign in to comment.