Skip to content

Commit 6143cb6

Browse files
authored
Merge pull request #1759 from rstudio/fix-ld-path-setting-on-linux
Resolve `oldlibpath` even if nothing to set.
2 parents 2c5cdcc + 49e8516 commit 6143cb6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
- Internal fixes to prevent reticulate-managed `uv` from writing outside
2121
reticulates cache directory (#1745).
22+
23+
- Fixed an issue with pointing reticulate at a pyenv shim python (#1758)
2224

2325
# reticulate 1.41.0
2426

R/config.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ prefix_python_lib_to_ld_library_path <- function(python) {
774774
python <- c(python, normalizePath(python, mustWork = FALSE))
775775
libpath <- file.path(dirname(dirname(python)), "lib")
776776
libpath <- libpath[file.exists(libpath)]
777+
oldlibpath <- Sys.getenv("LD_LIBRARY_PATH", unset = NA)
777778
if (length(libpath)) {
778-
oldlibpath <- Sys.getenv("LD_LIBRARY_PATH", unset = NA)
779779
newlibpath <- paste0(c(libpath, oldlibpath), collapse = ":")
780780
Sys.setenv(LD_LIBRARY_PATH = newlibpath)
781781
}

0 commit comments

Comments
 (0)