summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-02-15 00:35:56 +0900
committerGitHub <noreply@github.com>2020-02-15 00:35:56 +0900
commit8576e97e34a9b39189cb4e8188407002cdab1a27 (patch)
tree5091c6793e32864ccd2f12cbb252ab0991ba1c97
parentf2ec4bfeb74d2f8861ce9d5d30f63ef18c3e079d (diff)
parentbaf4c7df23b4b83ca18e88a8ccd785d2af878cf5 (diff)
downloadsphinx-git-8576e97e34a9b39189cb4e8188407002cdab1a27.tar.gz
Merge pull request #7150 from tk0miya/deprecate_getargspec
Deprecate sphinx.util.inspect.getargspec()
-rw-r--r--CHANGES1
-rw-r--r--doc/extdev/deprecated.rst5
-rw-r--r--sphinx/util/inspect.py4
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index af9ed7af9..92dc4637e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -30,6 +30,7 @@ Deprecated
* ``sphinx.domains.std.StandardDomain.add_object()``
* ``sphinx.testing.path.Path.text()``
* ``sphinx.testing.path.Path.bytes()``
+* ``sphinx.util.inspect.getargspec()``
Features added
--------------
diff --git a/doc/extdev/deprecated.rst b/doc/extdev/deprecated.rst
index c507adbc9..3a9c024af 100644
--- a/doc/extdev/deprecated.rst
+++ b/doc/extdev/deprecated.rst
@@ -41,6 +41,11 @@ The following is a list of deprecated interfaces.
- 5.0
- ``sphinx.testing.path.Path.read_bytes()``
+ * - ``sphinx.util.inspect.getargspec()``
+ - 3.0
+ - 5.0
+ - ``inspect.getargspec()``
+
* - ``decode`` argument of ``sphinx.pycode.ModuleAnalyzer()``
- 2.4
- 4.0
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index af8102402..80cac97d9 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -22,7 +22,7 @@ from inspect import ( # NOQA
from io import StringIO
from typing import Any, Callable, Mapping, List, Tuple
-from sphinx.deprecation import RemovedInSphinx40Warning
+from sphinx.deprecation import RemovedInSphinx40Warning, RemovedInSphinx50Warning
from sphinx.util import logging
from sphinx.util.typing import stringify as stringify_annotation
@@ -54,6 +54,8 @@ memory_address_re = re.compile(r' at 0x[0-9a-f]{8,16}(?=>)', re.IGNORECASE)
def getargspec(func):
"""Like inspect.getfullargspec but supports bound methods, and wrapped
methods."""
+ warnings.warn('sphinx.ext.inspect.getargspec() is deprecated',
+ RemovedInSphinx50Warning)
# On 3.5+, signature(int) or similar raises ValueError. On 3.4, it
# succeeds with a bogus signature. We want a TypeError uniformly, to
# match historical behavior.