Skip to content

Commit ce6a10b

Browse files
committed
making pickle compatible py 2 and 3
1 parent d686bde commit ce6a10b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test:
4646
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_fsl_reuse Linear /root/examples/ level1_workflow
4747
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py27 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ level1
4848
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ level1
49-
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_nested Linear /root/examples/ l2pipeline
49+
- docker run -v /etc/localtime:/etc/localtime:ro -v ~/examples:/root/examples:ro -v ~/scratch:/scratch -w /scratch nipype/nipype_test:py35 /usr/bin/run_examples.sh fmri_spm_nested MultiProc /root/examples/ l2pipeline
5050

5151
post:
5252
- bash docker/circleci/teardown.sh

nipype/utils/filemanip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,12 @@ def loadpkl(infile):
475475

476476

477477
def savepkl(filename, record):
478+
content = pickle.dumps(record)
478479
if filename.endswith('pklz'):
479480
pkl_file = gzip.open(filename, 'wb')
480481
else:
481482
pkl_file = open(filename, 'wb')
482-
pickle.dump(record, pkl_file)
483+
pkl_file.write(content.encode())
483484
pkl_file.close()
484485

485486
rst_levels = ['=', '-', '~', '+']

0 commit comments

Comments
 (0)