From c890e6125de2d48c092eeec4a336ee0dd3343319 Mon Sep 17 00:00:00 2001 From: Roman Kuzmenko Date: Tue, 2 Jan 2024 20:30:54 -0800 Subject: [PATCH] Default to the sanbox type "none" if "conda" is not found --- src/partcad/user_config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/partcad/user_config.py b/src/partcad/user_config.py index 2a88e03..78f29b5 100644 --- a/src/partcad/user_config.py +++ b/src/partcad/user_config.py @@ -8,6 +8,7 @@ import logging import os +import shutil import yaml @@ -26,7 +27,11 @@ def __init__(self): # description: sandboxing environment for invoking python scripts # values: [none | pypy | conda] # default: conda - self.python_runtime = "conda" + if not shutil.which("conda") is None: + self.python_runtime = "conda" + else: + self.python_runtime = "none" + if "pythonSandbox" in self.config_obj: self.python_runtime = self.config_obj["pythonSandbox"]