Skip to content

Commit d229703

Browse files
committed
Use conda.cli.main rather than check_call
1 parent e56e2f8 commit d229703

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/test_install.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ def main() -> None:
6868
for idx, arg in enumerate(args):
6969
if arg == "install":
7070
args.insert(idx +1, "-y")
71-
subprocess.check_call(args)
71+
import conda.cli
72+
if conda.cli.main(args) != 0:
73+
print(f"{cmd} failed")
74+
sys.exit(1)
7275

7376
# Check that torch is importable after install
7477
subprocess.check_call([sys.executable, "-c", "import torch;print('PyTorch version is ', torch.__version__)"])

0 commit comments

Comments
 (0)