Skip to content

Commit

Permalink
catch errors that occur when retrieving Python help
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Jan 23, 2019
1 parent 7f7da42 commit f95fae7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cpp/session/modules/SessionReticulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -1323,9 +1323,13 @@ html.heading = _heading
if (inherits(object, "error"))
return(error)

# extract argument names using inspect
# extract argument names using inspect (note that this can fail for
# some Python function types; e.g. builtin Python functions)
inspect <- reticulate::import("inspect", convert = TRUE)
spec <- inspect$getargspec(object)
spec <- .rs.tryCatch(inspect$getargspec(object))
if (inherits(spec, "error"))
return(error)

args <- spec$args

# attempt to scrape parameter documentation
Expand Down

0 comments on commit f95fae7

Please sign in to comment.