Skip to content

Commit

Permalink
Fix #4019: exception treatment for NoneType group attibute.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpizetta committed Sep 4, 2017
1 parent ff06cb8 commit eb9c18b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sphinx/ext/inheritance_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,18 @@ def try_import(objname):
__import__(objname)
return sys.modules.get(objname) # type: ignore
except ImportError:
modname, attrname = module_sig_re.match(objname).groups() # type: ignore
if modname is None:
return None
try:
__import__(modname)
return getattr(sys.modules.get(modname), attrname, None)
except ImportError:
modname, attrname = module_sig_re.match(objname).groups() # type: ignore
except AttributeError:
return None
else:
if modname is None:
return None
try:
__import__(modname)
return getattr(sys.modules.get(modname), attrname, None)
except ImportError:
return None


def import_classes(name, currmodule):
Expand Down

0 comments on commit eb9c18b

Please sign in to comment.