Skip to content

Commit

Permalink
Honor RETICULATE_REMAP_OUTPUT_STREAMS if it's set.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Jul 12, 2023
1 parent 19206ad commit c924b74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/output.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ reset_output_streams <- function() {
}

set_knitr_python_stdout_hook <- function() {
# if the env var is set to 0, we respect it and never remap. If the env var is 1
# this means that remapping is already set and we don't need the hook anyway.
if (!is.na(Sys.getenv("RETICULATE_REMAP_OUTPUT_STREAMS", unset = NA)))
return()

# we don't want to to force a knitr load namespace, so if it's already loaded
# we set the knitr hook, otherwise we schedule an onLoad hook.
if (isNamespaceLoaded("knitr")) {
Expand Down

0 comments on commit c924b74

Please sign in to comment.