diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 133d061a04..9f7949cf67 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -766,7 +766,8 @@ class Segment(SPMCommand): """ - if Info.version() and Info.version()['name'] == "SPM12": + _local_version = SPMCommand().version + if _local_version and '12.' in _local_version: _jobtype = 'tools' _jobname = 'oldseg' else: @@ -893,7 +894,8 @@ class NewSegment(SPMCommand): input_spec = NewSegmentInputSpec output_spec = NewSegmentOutputSpec - if Info.version() and Info.version()['name'] == "SPM12": + _local_version = SPMCommand().version + if _local_version and '12.' in _local_version: _jobtype = 'spatial' _jobname = 'preproc' else: diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index f2d136b2b9..2cab617a74 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -450,7 +450,7 @@ def _list_outputs(self): from glob import glob outputs = self._outputs().get() od = os.path.abspath(self.inputs.output_dir) - + ext = self.inputs.format if self.inputs.output_dir_struct == "flat": outputs['out_files'] = glob(os.path.join(od, '*.%s'%ext)) diff --git a/nipype/pipeline/utils.py b/nipype/pipeline/utils.py index 27351c8fc5..73f251049a 100644 --- a/nipype/pipeline/utils.py +++ b/nipype/pipeline/utils.py @@ -993,7 +993,7 @@ def clean_working_directory(outputs, cwd, inputs, needed_outputs, config, inputdict = inputs.get() input_files.extend(walk_outputs(inputdict)) needed_files += [path for path, type in input_files if type == 'f'] - for extra in ['_0x*.json', 'provenance.*', 'pyscript*.m', + for extra in ['_0x*.json', 'provenance.*', 'pyscript*.m', 'pyjobs*.mat', 'command.txt', 'result*.pklz', '_inputs.pklz', '_node.pklz']: needed_files.extend(glob(os.path.join(cwd, extra))) if files2keep: