Skip to content

Commit

Permalink
allow disabling the Python finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Sep 8, 2024
1 parent 26c1c22 commit 3689fab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ initialize_python <- function(required_module = NULL, use_environment = NULL) {

)

reg.finalizer(.globals, function(e) py_finalize(), onexit = TRUE)
# allow disabling the Python finalizer
if (!tolower(Sys.getenv("RETICULATE_DISABLE_PYTHON_FINALIZER")) %in% c("true", "1", "yes"))
reg.finalizer(.globals, function(e) py_finalize(), onexit = TRUE)

# set available flag indicating we have py bindings
config$available <- TRUE
Expand Down

0 comments on commit 3689fab

Please sign in to comment.