mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4597 from tk0miya/4596_issubclass
Fix #4596: TypeError: issubclass() arg 1 must be a class
This commit is contained in:
commit
2a65ffeef5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user