mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Revert the changes of directive_helper
This commit is contained in:
parent
04995b703f
commit
25b96b833d
@ -31,7 +31,7 @@ report_re = re.compile('^(.+?:(?:\\d+)?): \\((DEBUG|INFO|WARNING|ERROR|SEVERE)/(
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, Callable, Dict, Generator, Iterator, List, Tuple # NOQA
|
||||
from typing import Any, Callable, Generator, Iterator, List, Tuple # NOQA
|
||||
from docutils import nodes # NOQA
|
||||
from docutils.statemachine import State # NOQA
|
||||
from sphinx.environment import BuildEnvironment # NOQA
|
||||
@ -205,12 +205,12 @@ def is_html5_writer_available():
|
||||
return __version_info__ > (0, 13, 0)
|
||||
|
||||
|
||||
def directive_helper(obj, has_content=None, argument_spec=None, option_spec=None, **options):
|
||||
# type: (Any, bool, Tuple[int, int, bool], Dict, Any) -> Any
|
||||
def directive_helper(obj, has_content=None, argument_spec=None, **option_spec):
|
||||
# type: (Any, bool, Tuple[int, int, bool], Any) -> Any
|
||||
if isinstance(obj, (types.FunctionType, types.MethodType)):
|
||||
obj.content = has_content # type: ignore
|
||||
obj.arguments = argument_spec or (0, 0, False) # type: ignore
|
||||
obj.options = option_spec or options # type: ignore
|
||||
obj.options = option_spec # type: ignore
|
||||
return convert_directive_function(obj)
|
||||
else:
|
||||
if has_content or argument_spec or option_spec:
|
||||
|
Loading…
Reference in New Issue
Block a user