We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 09d55ec + 19ce2c1 commit 13a7556Copy full SHA for 13a7556
nipype/utils/filemanip.py
@@ -682,6 +682,7 @@ def loadpkl(infile):
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
@@ -711,11 +712,14 @@ def loadpkl(infile):
711
712
No metadata was found in the pkl file. Make sure you are currently using \
713
the same Nipype version from the generated pkl.""")
714
raise e
- else:
715
- return unpkl
716
finally:
717
pkl_file.close()
718
+ if unpkl is None:
719
+ raise ValueError('Loading %s resulted in None.' % infile)
720
+
721
+ return unpkl
722
723
724
def crash2txt(filename, record):
725
""" Write out plain text crash file """
0 commit comments