Skip to content

Commit 96b257e

Browse files
committed
trying silent failure
1 parent 008785c commit 96b257e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

R/aaa_base.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
stepcount_base = function() {
22
sc = reticulate::import("stepcount")
3-
stepcount = sc$stepcount
3+
stepcount = try({sc$stepcount})
4+
if (inherits(stepcount, "try-error")) {
5+
stepcount = reticulate::import("stepcount.stepcount")
6+
}
47
stepcount
58
}
69

710

811
stepcount_base_noconvert = function() {
912
sc = reticulate::import("stepcount", convert = FALSE)
10-
stepcount = sc$stepcount
13+
stepcount = try({sc$stepcount})
14+
if (inherits(stepcount, "try-error")) {
15+
stepcount = reticulate::import("stepcount.stepcount", convert = FALSE)
16+
}
1117
stepcount
1218
}

0 commit comments

Comments
 (0)