Fix FileNotFoundException crash in find_python_executable_for_version (#164)

This commit is contained in:
12037964+ae-ae@users.noreply.github.com 12037964+ae-ae@users.noreply.github.com 2024-02-25 23:43:47 +03:00
parent 95dde6ca0c
commit 4f6f1e29d4

View File

@ -3320,7 +3320,14 @@ class Worker(ServiceCommandSection):
stderr=subprocess.STDOUT
)
except subprocess.CalledProcessError as ex:
self.log.warning("error getting %s version: %s", executable, ex)
# Windows return 9009 code and suggest to install Python from Windows Store
if ex.returncode == 9009:
self.log.debug("version not found: {}".format(ex))
else:
self.log.warning("error getting %s version: %s", executable, ex)
continue
except FileNotFoundError as ex:
self.log.debug("version not found: {}".format(ex))
continue
if not default_python: