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):
682
682
pklopen = gzip .open if infile .suffix == '.pklz' else open
683
683
pkl_metadata = None
684
684
685
+ unpkl = None
685
686
with indirectory (infile .parent ):
686
687
pkl_file = pklopen (infile .name , 'rb' )
687
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 \
717
718
the same Nipype version from the generated pkl.""" )
718
719
raise e
719
- else :
720
- return unpkl
721
720
finally :
722
721
pkl_file .close ()
723
722
723
+ if unpkl is None :
724
+ raise ValueError ('Loading %s resulted in None.' % infile )
725
+
726
+ return unpkl
727
+
724
728
725
729
def crash2txt (filename , record ):
726
730
""" Write out plain text crash file """
You can’t perform that action at this time.
0 commit comments