Skip to content

Commit 503806e

Browse files
Generalize internal deprecateFutureArgument()
1 parent 536303d commit 503806e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.68.0-9016
2+
Version: 1.68.0-9017
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

R/009.deprecation.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
deprecate_future_earlySignal <- function(earlySignal) {
2-
action <- getOption("future.future.earlySignal", "deprecated")
1+
deprecateFutureArgument <- function(name, value) {
2+
option <- sprintf("future.future.%s", name)
3+
action <- getOption(option, "deprecated")
34
action <- match.arg(action, choices = c("deprecated", "defunct", "ignore"))
45
if (action == "ignore") return()
56
dfcn <- if (action == "deprecated") .Deprecated else .Defunct
6-
dfcn(msg = sprintf("future() no longer takes argument 'earlySignal'. Attempts to use it is ignored, but will eventually become an error: earlySignal = %s", deparse(earlySignal)[1]))
7+
dfcn(msg = sprintf("future() no longer takes argument '%s'. Attempts to use it is ignored, but will eventually become an error: %s = %s", name, name, deparse(value)[1]))
78
}
89

R/core_api-future.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ future <- function(expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE
207207
## Deprecation of 'earlySignal'
208208
if (!is.null(future[["earlySignal"]])) {
209209
if (is.element("earlySignal", args_names)) {
210-
deprecate_future_earlySignal(future[["earlySignal"]])
210+
deprecateFutureArgument("earlySignal", future[["earlySignal"]])
211211
}
212212
}
213213

0 commit comments

Comments
 (0)