From 637d3aa8fbbba75948f157b525c8821166d7161a Mon Sep 17 00:00:00 2001 From: "Andrew G. Brown" Date: Thu, 17 Aug 2023 14:26:49 -0700 Subject: [PATCH] bugfix for no detectable python config --- R/find_python.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/find_python.R b/R/find_python.R index 2782255..f021fe1 100644 --- a/R/find_python.R +++ b/R/find_python.R @@ -70,7 +70,7 @@ find_python <- function(envname = NULL, # find newest python installation with rosetta installed x <- try(reticulate::py_discover_config("rosetta")) - if (length(x$python_versions) > 0) { + if (!is.null(x$python_versions)) { xxx <- lapply(x$python_versions, function(x) { y <- gsub("Python ", "", system(paste(shQuote(x), "--version"), intern = TRUE, ignore.stdout = TRUE, ignore.stderr = TRUE)) if (length(y) == 0) return("0") @@ -83,7 +83,7 @@ find_python <- function(envname = NULL, # otherwise find newest python installation if (is.null(res) || inherits(res, 'try-error')) { x <- try(reticulate::py_discover_config()) - if (length(x$python_versions) > 0) { + if (!is.null(x$python_versions)) { xxx <- lapply(x$python_versions, function(x) { y <- gsub("Python ", "", system(paste(shQuote(x), "--version"), intern = TRUE, ignore.stdout = TRUE, ignore.stderr = TRUE, show.output.on.console = FALSE)) if (length(y) == 0) return("0")