Skip to content

Commit

Permalink
Merge pull request #1675 from rstudio/fix/platform-detection-on-windows
Browse files Browse the repository at this point in the history
Better handle silent errors
  • Loading branch information
t-kalinowski authored Sep 23, 2024
2 parents 8a38c9a + 6974279 commit 4887f8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,11 @@ py_discover_config <- function(required_module = NULL, use_environment = NULL) {
# https://github.com/rstudio/reticulate/issues/1325
get_platform <- function(python) {
tryCatch({
system2(python,
args = c("-c", shQuote("import sys; print(sys.platform)")),
stdout = TRUE, stderr = FALSE)
plat <- system2(python,
args = c("-c", shQuote("import sys; print(sys.platform)")),
stdout = TRUE, stderr = FALSE
)
if (rlang::is_string(plat)) plat else ""
}, warning = function(w) "", error = function(e) "")
}
python_sys_platforms <- vapply(python_versions, get_platform, "")
Expand Down

0 comments on commit 4887f8c

Please sign in to comment.