File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -682,6 +682,7 @@ def loadpkl(infile, versioning=False):
682682 pklopen = gzip .open if infile .suffix == '.pklz' else open
683683 pkl_metadata = None
684684
685+ unpkl = None
685686 with indirectory (infile .parent ):
686687 pkl_file = pklopen (infile .name , 'rb' )
687688
@@ -716,11 +717,14 @@ def loadpkl(infile, versioning=False):
716717 No metadata was found in the pkl file. Make sure you are currently using \
717718 the same Nipype version from the generated pkl.""" )
718719 raise e
719- else :
720- return unpkl
721720 finally :
722721 pkl_file .close ()
723722
723+ if unpkl is None :
724+ raise ValueError ('Loading %s resulted in None.' % infile )
725+
726+ return unpkl
727+
724728
725729def crash2txt (filename , record ):
726730 """ Write out plain text crash file """
You can’t perform that action at this time.
0 commit comments