Skip to content

Commit 7774e3f

Browse files
Update nipype/pipeline/engine/workflows.py
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent d9bee32 commit 7774e3f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nipype/pipeline/engine/workflows.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,8 @@ def write_hierarchical_dotfile(
486486
dotlist = self._get_dot(prefix=" ", colored=colored, simple_form=simple_form)
487487
dotstr = f"digraph {self.name}{{\n{dotlist}\n}}"
488488
if dotfilename:
489-
fp = open(dotfilename, "w")
490-
fp.writelines(dotstr)
491-
fp.close()
489+
with open(dotfilename, "w") as fp:
490+
fp.writelines(dotstr)
492491
else:
493492
logger.info(dotstr)
494493

0 commit comments

Comments
 (0)