Merge pull request #4597 from tk0miya/4596_issubclass

Fix #4596: TypeError: issubclass() arg 1 must be a class
This commit is contained in:
Takeshi KOMIYA 2018-02-12 20:58:11 +09:00 committed by GitHub
commit 2a65ffeef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ import posixpath
import sys
import warnings
from collections import deque
from inspect import isclass
from os import path
from docutils import nodes
@ -737,7 +738,7 @@ class Sphinx(object):
directive = directive_helper(obj, content, arguments, **options)
directives.register_directive(name, directive)
if not issubclass(obj, Directive):
if not isclass(obj) or not issubclass(obj, Directive):
warnings.warn('function based directive support is now deprecated. '
'Use class based directive instead.',
RemovedInSphinx30Warning)