Skip to content

Commit 5795fc7

Browse files
authored
Update sphinx.deprecation for Sphinx 7.0 (#11386)
1 parent 6202087 commit 5795fc7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sphinx/deprecation.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
import warnings
66

77

8-
class RemovedInSphinx70Warning(DeprecationWarning):
8+
class RemovedInSphinx80Warning(DeprecationWarning):
99
pass
1010

1111

12-
class RemovedInSphinx80Warning(PendingDeprecationWarning):
12+
class RemovedInSphinx90Warning(PendingDeprecationWarning):
1313
pass
1414

1515

16-
RemovedInNextVersionWarning = RemovedInSphinx70Warning
16+
RemovedInNextVersionWarning = RemovedInSphinx80Warning
1717

1818

1919
def _deprecation_warning(
@@ -31,7 +31,7 @@ def _deprecation_warning(
3131
3232
# deprecated name -> (object to return, canonical path or empty string)
3333
_DEPRECATED_OBJECTS = {
34-
'deprecated_name': (object_to_return, 'fully_qualified_replacement_name'),
34+
'deprecated_name': (object_to_return, 'fully_qualified_replacement_name', (8, 0)),
3535
}
3636
3737
@@ -41,15 +41,15 @@ def __getattr__(name):
4141
4242
from sphinx.deprecation import _deprecation_warning
4343
44-
deprecated_object, canonical_name = _DEPRECATED_OBJECTS[name]
45-
_deprecation_warning(__name__, name, canonical_name, remove=(7, 0))
44+
deprecated_object, canonical_name, remove = _DEPRECATED_OBJECTS[name]
45+
_deprecation_warning(__name__, name, canonical_name, remove=remove)
4646
return deprecated_object
4747
"""
4848

49-
if remove == (7, 0):
50-
warning_class: type[Warning] = RemovedInSphinx70Warning
51-
elif remove == (8, 0):
52-
warning_class = RemovedInSphinx80Warning
49+
if remove == (8, 0):
50+
warning_class: type[Warning] = RemovedInSphinx80Warning
51+
elif remove == (9, 0):
52+
warning_class = RemovedInSphinx90Warning
5353
else:
5454
raise RuntimeError(f'removal version {remove!r} is invalid!')
5555

0 commit comments

Comments
 (0)