Don't try to run issubclass on non-classes
issubclass gets cranky if you give it a first argument that is not a class. http://logs.openstack.org/74/612474/2/check/cross-osc-build-sphinx-docs/42250a7/job-output.txt.gz#_2018-10-26_08_02_08_597700 Shows a failure when trying to build python-openstackclient docs with the cliff sphinxext after updating openstacksdk in such a way that an import error went away. Change-Id: Id1d17c66e5dd6e430376a8d6ea74abc4da5cbc75
This commit is contained in:
parent
686f876b02
commit
cd6cd9d2d7
|
@ -15,6 +15,7 @@
|
|||
import argparse
|
||||
import fnmatch
|
||||
import importlib
|
||||
import inspect
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
@ -242,6 +243,8 @@ class AutoprogramCliffDirective(rst.Directive):
|
|||
cliff_app_class = getattr(sys.modules[mod_str], class_str)
|
||||
except AttributeError:
|
||||
return
|
||||
if not inspect.isclass(cliff_app_class):
|
||||
return
|
||||
if not issubclass(cliff_app_class, app.App):
|
||||
return
|
||||
app_arguments = self.options.get('arguments', '').split()
|
||||
|
|
Loading…
Reference in New Issue