We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 508df5e commit c178fbbCopy full SHA for c178fbb
nipype/utils/filemanip.py
@@ -682,6 +682,7 @@ def loadpkl(infile, versioning=False):
682
pklopen = gzip.open if infile.suffix == '.pklz' else open
683
pkl_metadata = None
684
685
+ unpkl = None
686
with indirectory(infile.parent):
687
pkl_file = pklopen(infile.name, 'rb')
688
@@ -716,11 +717,14 @@ def loadpkl(infile, versioning=False):
716
717
No metadata was found in the pkl file. Make sure you are currently using \
718
the same Nipype version from the generated pkl.""")
719
raise e
- else:
720
- return unpkl
721
finally:
722
pkl_file.close()
723
+ if unpkl is None:
724
+ raise ValueError('Loading %s resulted in None.' % infile)
725
+
726
+ return unpkl
727
728
729
def crash2txt(filename, record):
730
""" Write out plain text crash file """
0 commit comments