fix crash on macOS when opening OpenSCAD Workbench
The OpenSCAD Workbench crashes on open on macOS with error "a bytes-like object is required, not 'str'", due to python 2 to python 3 incompatibility. This is me implementing the fix described by oapa at https://forum.freecadweb.org/viewtopic.php?t=35384#p311908 (with an untested attempt to make it also still run with python 2).
This commit is contained in:
@@ -77,7 +77,7 @@ def searchforopenscadexe():
|
||||
stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||
stdout,stderr = p1.communicate(ascript)
|
||||
if p1.returncode == 0:
|
||||
opathl=stdout.split('\n')
|
||||
opathl = stdout.decode().split('\n') if sys.version_info.major >= 3 else stdout.split('\n')
|
||||
if len(opathl) >=1:
|
||||
return opathl[0]+'Contents/MacOS/OpenSCAD'
|
||||
#test the default path
|
||||
|
||||
Reference in New Issue
Block a user