From 9ca9e4a89a532e7f135f523616043d16621b06d3 Mon Sep 17 00:00:00 2001 From: lorenz Date: Sun, 31 Mar 2019 15:08:35 +0200 Subject: [PATCH] FEM: osx: try to fix default ccx detection --- src/Mod/Fem/femtools/ccxtools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/femtools/ccxtools.py b/src/Mod/Fem/femtools/ccxtools.py index b60b1f4be1..27d3d33596 100644 --- a/src/Mod/Fem/femtools/ccxtools.py +++ b/src/Mod/Fem/femtools/ccxtools.py @@ -580,11 +580,11 @@ class FemToolsCcx(QtCore.QRunnable, QtCore.QObject): ccx_path = FreeCAD.getHomePath() + "bin/ccx.exe" FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").SetString("ccxBinaryPath", ccx_path) self.ccx_binary = ccx_path - elif system() == "Linux": + elif system() in ("Linux", "Darwin"): p1 = subprocess.Popen(['which', 'ccx'], stdout=subprocess.PIPE) if p1.wait() == 0: if sys.version_info.major >= 3: - ccx_path = str(p1.stdout.read()).split('\n')[0] + ccx_path = p1.stdout.read().decode("utf8").split('\n')[0] else: ccx_path = p1.stdout.read().split('\n')[0] elif p1.wait() == 1: @@ -595,7 +595,8 @@ class FemToolsCcx(QtCore.QRunnable, QtCore.QObject): if FreeCAD.GuiUp: QtGui.QMessageBox.critical(None, error_title, error_message) raise Exception(error_message) - self.ccx_binary = ccx_path + # we use the default ccx command and we don't have to use the path to ccx for calling it + # self.ccx_binary = ccx_path else: if not ccx_binary: self.ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")