Skip to content
Merged
Changes from all commits
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
8 changes: 6 additions & 2 deletions nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ def loadpkl(infile):
pklopen = gzip.open if infile.suffix == '.pklz' else open
pkl_metadata = None

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

Expand Down Expand Up @@ -711,11 +712,14 @@ def loadpkl(infile):
No metadata was found in the pkl file. Make sure you are currently using \
the same Nipype version from the generated pkl.""")
raise e
else:
return unpkl
finally:
pkl_file.close()

if unpkl is None:
raise ValueError('Loading %s resulted in None.' % infile)

return unpkl


def crash2txt(filename, record):
""" Write out plain text crash file """
Expand Down