JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
570 stars 75 forks source link

Bundled python incorrectly tested on MacOS bundle #111

Closed needabetterusername closed 2 years ago

needabetterusername commented 2 years ago

Issue: On MacOS test for use_own_python will give a false negative due to the MacOS bundle structure.

Cause: In MacOS bundles, blender executable and python executable have a common parent. I.e. python executable is not in a subdirectory of the executable.

Evidence (log):

Blender: .../Contents/MacOS... Python : .../Contents/Resources...

python_path: /Applications/Blender/Blender.app/Contents/Resources/2.93/python/bin/python3.9

python_path.parents:
/Applications/Blender/Blender.app/Contents/Resources/2.93/python/bin
/Applications/Blender/Blender.app/Contents/Resources/2.93/python
/Applications/Blender/Blender.app/Contents/Resources/2.93
/Applications/Blender/Blender.app/Contents/Resources
/Applications/Blender/Blender.app
/Applications/Blender
/Applications
/

blender_directory: /Applications/Blender/Blender LTS 2.93.0.app/Contents/MacOS

Fix: I plan to submit a PR.

Adjust test based on Python platform call: platform.system(): Darwin