Drop Python 3.4 compatibility code

Python 3.4 support was dropped in Sphinx 2.0.
This commit is contained in:
François Freitag 2020-11-07 11:21:34 +01:00
parent a38ba8670a
commit fa8bec76e7
No known key found for this signature in database
GPG Key ID: 0CD53670BCA9253D

View File

@ -62,14 +62,6 @@ def getargspec(func: Callable) -> Any:
methods."""
warnings.warn('sphinx.ext.inspect.getargspec() is deprecated',
RemovedInSphinx50Warning, stacklevel=2)
# 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.
if (isinstance(func, type) and
is_builtin_class_method(func, "__new__") and
is_builtin_class_method(func, "__init__")):
raise TypeError(
"can't compute signature for built-in type {}".format(func))
sig = inspect.signature(func)