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():