posit-dev / publisher

MIT License
3 stars 0 forks source link

Handle internal exception when python.interpreterPath not defined #1738

Closed sagerb closed 2 months ago

sagerb commented 2 months ago

Intent

Python inspection fails when the mentioned command is not defined within VSCode. I was able to reproduce it by creating a new destination, but it exists in common code which would be traversed by other workflow as well.

resolves #1737

Type of Change

Approach

The commands.executeCommand command throws an exception when the command is not found, so I simply reworked the code with an empty try/catch block, with the existing logic check for an undefined return;

Automated Tests

Directions for Reviewers

For some reason, I don't have this command defined. All of my Python extensions are disabled, so perhaps doing that will reproduce this scenario.

Checklist

mmarchetti commented 2 months ago

Thanks. This should only happen if the VSCode Python extension is not installed, in which case there also wouldn't be a Python: Select Interpreter command to set it.

mmarchetti commented 2 months ago

~@sagerb Can you confirm that you don't have the Python extension installed?~

I see:

All of my Python extensions are disabled