Draft: importDWG.py wrongly assumed that opt directory always exists on Linux (#10447)

Forum topic:
https://forum.freecad.org/viewtopic.php?p=703063#p703061
This commit is contained in:
Roy-043
2023-08-30 18:10:13 +02:00
committed by GitHub
parent d5a9f78ad3
commit a66c9ee549

View File

@@ -244,10 +244,11 @@ def get_qcad_converter():
elif platform.system() == "Linux":
# /home/$USER/opt/qcad-3.28.1-trial-linux-qt5.14-x86_64/dwg2dwg
path = os.path.expandvars("/home/$USER/opt")
for sub in os.listdir(path):
if "qcad" in sub:
path = path + "/" + sub + "/" + "dwg2dwg"
break
if os.path.exists(path) and os.path.isdir(path):
for sub in os.listdir(path):
if "qcad" in sub:
path = path + "/" + sub + "/" + "dwg2dwg"
break
else: # for macOS
path = "/Applications/QCAD.app/Contents/Resources/dwg2dwg"