From fc23531e4ae34c64d9cc4a70049dd5cf19d44ef9 Mon Sep 17 00:00:00 2001 From: phaseloop <90922095+phaseloop@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:24:27 +0000 Subject: [PATCH] CAM: fix estlcam postprocessor (#20407) --- src/Mod/CAM/Path/Post/scripts/estlcam_post.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mod/CAM/Path/Post/scripts/estlcam_post.py b/src/Mod/CAM/Path/Post/scripts/estlcam_post.py index de508aaa16..ee47e9cc9d 100644 --- a/src/Mod/CAM/Path/Post/scripts/estlcam_post.py +++ b/src/Mod/CAM/Path/Post/scripts/estlcam_post.py @@ -327,10 +327,11 @@ def export(objectslist, filename, argstring): print("Done postprocessing.") - # write the file - gfile = pyopen(filename, "w") - gfile.write(final) - gfile.close() + if filename != "-": + with pyopen(filename, "w") as gfile: + gfile.write(final) + + return final def linenumber():