diff options
author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2023-04-28 12:10:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 12:10:13 +0100 |
commit | 5795fc7f9f7a5fe968cd11b961fc33fbd952a152 (patch) | |
tree | 9b23a82349679132286fda31eedb780a5d0f74dc | |
parent | 6202087f912a2ae32808865072f884ea44cd31cb (diff) | |
download | sphinx-git-5795fc7f9f7a5fe968cd11b961fc33fbd952a152.tar.gz |
Update ``sphinx.deprecation`` for Sphinx 7.0 (#11386)
-rw-r--r-- | sphinx/deprecation.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sphinx/deprecation.py b/sphinx/deprecation.py index fbd5463cc..d708fdaa0 100644 --- a/sphinx/deprecation.py +++ b/sphinx/deprecation.py @@ -5,15 +5,15 @@ from __future__ import annotations import warnings -class RemovedInSphinx70Warning(DeprecationWarning): +class RemovedInSphinx80Warning(DeprecationWarning): pass -class RemovedInSphinx80Warning(PendingDeprecationWarning): +class RemovedInSphinx90Warning(PendingDeprecationWarning): pass -RemovedInNextVersionWarning = RemovedInSphinx70Warning +RemovedInNextVersionWarning = RemovedInSphinx80Warning def _deprecation_warning( @@ -31,7 +31,7 @@ def _deprecation_warning( # deprecated name -> (object to return, canonical path or empty string) _DEPRECATED_OBJECTS = { - 'deprecated_name': (object_to_return, 'fully_qualified_replacement_name'), + 'deprecated_name': (object_to_return, 'fully_qualified_replacement_name', (8, 0)), } @@ -41,15 +41,15 @@ def _deprecation_warning( from sphinx.deprecation import _deprecation_warning - deprecated_object, canonical_name = _DEPRECATED_OBJECTS[name] - _deprecation_warning(__name__, name, canonical_name, remove=(7, 0)) + deprecated_object, canonical_name, remove = _DEPRECATED_OBJECTS[name] + _deprecation_warning(__name__, name, canonical_name, remove=remove) return deprecated_object """ - if remove == (7, 0): - warning_class: type[Warning] = RemovedInSphinx70Warning - elif remove == (8, 0): - warning_class = RemovedInSphinx80Warning + if remove == (8, 0): + warning_class: type[Warning] = RemovedInSphinx80Warning + elif remove == (9, 0): + warning_class = RemovedInSphinx90Warning else: raise RuntimeError(f'removal version {remove!r} is invalid!') |