Skip to content

Commit

Permalink
Merge pull request #1598 from rstudio/fix-broken-link-warning
Browse files Browse the repository at this point in the history
Ignore broken links encountered by `virtualenv_starter()`
  • Loading branch information
t-kalinowski committed Apr 23, 2024
2 parents 98df67a + 49ec37d commit d4e752b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# reticulate (development version)

- `virtualenv_starter()` no longer warns when encountering broken symlinks (#1598).

# reticulate 1.36.1

- Fix issue where `py_to_r()` method for Pandas DataFrames would error
Expand Down
4 changes: 3 additions & 1 deletion R/virtualenv.R
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,10 @@ virtualenv_starter <- function(version = NULL, all = FALSE) {
suffix)
}

p <- unique(normalizePath(Sys.glob(glob), winslash = "/"))
p <- unique(normalizePath(Sys.glob(glob), winslash = "/", mustWork = FALSE))
p <- p[grep("^python[0-9.]*(\\.exe)?$", basename(p))]
p <- p[utils::file_test("-x", p)]
p <- p[utils::file_test("-f", p)]
v <- numeric_version(vapply(p, function(python_path)
tryCatch({
v <- suppressWarnings(system2(
Expand Down

0 comments on commit d4e752b

Please sign in to comment.