mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Update `sphinx.deprecation
` for Sphinx 8.0 (#12651)
This commit is contained in:
parent
f31dbabf20
commit
bf57d21fcd
@ -5,15 +5,15 @@ from __future__ import annotations
|
||||
import warnings
|
||||
|
||||
|
||||
class RemovedInSphinx80Warning(DeprecationWarning):
|
||||
class RemovedInSphinx90Warning(DeprecationWarning):
|
||||
pass
|
||||
|
||||
|
||||
class RemovedInSphinx90Warning(PendingDeprecationWarning):
|
||||
class RemovedInSphinx10Warning(PendingDeprecationWarning):
|
||||
pass
|
||||
|
||||
|
||||
RemovedInNextVersionWarning = RemovedInSphinx80Warning
|
||||
RemovedInNextVersionWarning = RemovedInSphinx90Warning
|
||||
|
||||
|
||||
def _deprecation_warning(
|
||||
@ -40,7 +40,7 @@ def _deprecation_warning(
|
||||
|
||||
# deprecated name -> (object to return, canonical path or empty string, removal version)
|
||||
_DEPRECATED_OBJECTS = {
|
||||
'deprecated_name': (object_to_return, 'fully_qualified_replacement_name', (8, 0)),
|
||||
'deprecated_name': (object_to_return, 'fully_qualified_replacement_name', (9, 0)),
|
||||
}
|
||||
|
||||
|
||||
@ -55,10 +55,10 @@ def _deprecation_warning(
|
||||
_deprecation_warning(__name__, name, canonical_name, remove=remove)
|
||||
return deprecated_object
|
||||
"""
|
||||
if remove == (8, 0):
|
||||
warning_class: type[Warning] = RemovedInSphinx80Warning
|
||||
elif remove == (9, 0):
|
||||
warning_class = RemovedInSphinx90Warning
|
||||
if remove == (9, 0):
|
||||
warning_class: type[Warning] = RemovedInSphinx90Warning
|
||||
elif remove == (10, 0):
|
||||
warning_class = RemovedInSphinx10Warning
|
||||
else:
|
||||
msg = f'removal version {remove!r} is invalid!'
|
||||
raise RuntimeError(msg)
|
||||
|
Loading…
Reference in New Issue
Block a user