Skip to content

Commit 5495816

Browse files
author
Ben Cipollini
committed
RF: file => open
1 parent 978c551 commit 5495816

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nipype/interfaces/matlab.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,8 @@ def _gen_matlab_command(self, argstr, script_lines):
179179

180180
script_lines = '\n'.join(prescript)+script_lines+'\n'.join(postscript)
181181
if mfile:
182-
mfile = file(os.path.join(cwd,self.inputs.script_file), 'wt')
183-
mfile.write(script_lines)
184-
mfile.close()
182+
with open(os.path.join(cwd,self.inputs.script_file), 'wt') as mfile:
183+
mfile.write(script_lines)
185184
if self.inputs.uses_mcr:
186185
script = '%s' % (os.path.join(cwd,self.inputs.script_file))
187186
else:

0 commit comments

Comments
 (0)