mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate sphinx.util.inspect.getargspec()
This commit is contained in:
1
CHANGES
1
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
|
||||
--------------
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user