From 3db1fd122623d912f8eb4364c7e6d51bb6019fe5 Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Sun, 21 Apr 2019 11:53:37 -0700 Subject: [PATCH] Fixed error when an invalid object is given to an autodoc directive --- autoapi/documenters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoapi/documenters.py b/autoapi/documenters.py index 80fab47..b2e746c 100644 --- a/autoapi/documenters.py +++ b/autoapi/documenters.py @@ -42,7 +42,7 @@ class AutoapiDocumenter(autodoc.Documenter): for num_splits in range(max_splits, -1, -1): path_stack = list(reversed(self.fullname.rsplit(".", num_splits))) objects = self.env.autoapi_mapper.objects - parent = objects[path_stack.pop()] + parent = objects.get(path_stack.pop()) while parent and path_stack: parent = self.get_attr(parent, path_stack.pop(), None)