File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,10 @@ def get_doc(self) -> list[list[str]]:
313313 "Args:" ,
314314 ]
315315
316- dataset = self .parent ()
316+ try :
317+ dataset = self .parent ()
318+ except TypeError :
319+ return ["" ]
317320 for item in dataset .get_items ():
318321 docstring_lines .append (ItemDoc (dataset , item ).to_function_parameter ())
319322
@@ -392,7 +395,11 @@ def get_doc(self) -> list[list[str]]:
392395 ]
393396 if not self .options .get ("hideattr" , False ):
394397 docstring_lines .extend (("" , "Attributes:" ))
395- dataset = self .object ()
398+ try :
399+ dataset = self .object ()
400+ except TypeError :
401+ # May occur when trying to instantiate an abstract class
402+ return [["" ]]
396403 for item in dataset .get_items ():
397404 docstring_lines .append (ItemDoc (dataset , item ).to_attribute ())
398405
You can’t perform that action at this time.
0 commit comments