summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc/inspector.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/ext/autodoc/inspector.py')
-rw-r--r--sphinx/ext/autodoc/inspector.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/ext/autodoc/inspector.py b/sphinx/ext/autodoc/inspector.py
index be42237c6..52a79fed5 100644
--- a/sphinx/ext/autodoc/inspector.py
+++ b/sphinx/ext/autodoc/inspector.py
@@ -33,7 +33,7 @@ def format_annotation(annotation):
"""
warnings.warn('format_annotation() is now deprecated. '
'Please use sphinx.util.inspect.Signature instead.',
- RemovedInSphinx20Warning)
+ RemovedInSphinx20Warning, stacklevel=2)
if isinstance(annotation, typing.TypeVar): # type: ignore
return annotation.__name__
if annotation == Ellipsis:
@@ -114,7 +114,7 @@ def formatargspec(function, args, varargs=None, varkw=None, defaults=None,
"""
warnings.warn('formatargspec() is now deprecated. '
'Please use sphinx.util.inspect.Signature instead.',
- RemovedInSphinx20Warning)
+ RemovedInSphinx20Warning, stacklevel=2)
def format_arg_with_annotation(name):
# type: (str) -> str