diff --git a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py index 6a466f474c..399de11221 100644 --- a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py @@ -352,7 +352,13 @@ def export(objectslist, filename, argstring): if FreeCAD.GuiUp and SHOW_EDITOR: dia = PostUtils.GCodeEditorDialog() - dia.editor.setPlainText(gcode) + + # Workaround for 1.1 while we wait for + # https://github.com/FreeCAD/FreeCAD/pull/26008 to be merged. + if hasattr(dia.editor, "setPlainText"): + dia.editor.setPlainText(gcode) + else: + dia.editor.setText(gcode) result = dia.exec_() if result: final = dia.editor.toPlainText()