5
5
import warnings
6
6
7
7
8
- class RemovedInSphinx70Warning (DeprecationWarning ):
8
+ class RemovedInSphinx80Warning (DeprecationWarning ):
9
9
pass
10
10
11
11
12
- class RemovedInSphinx80Warning (PendingDeprecationWarning ):
12
+ class RemovedInSphinx90Warning (PendingDeprecationWarning ):
13
13
pass
14
14
15
15
16
- RemovedInNextVersionWarning = RemovedInSphinx70Warning
16
+ RemovedInNextVersionWarning = RemovedInSphinx80Warning
17
17
18
18
19
19
def _deprecation_warning (
@@ -31,7 +31,7 @@ def _deprecation_warning(
31
31
32
32
# deprecated name -> (object to return, canonical path or empty string)
33
33
_DEPRECATED_OBJECTS = {
34
- 'deprecated_name': (object_to_return, 'fully_qualified_replacement_name'),
34
+ 'deprecated_name': (object_to_return, 'fully_qualified_replacement_name', (8, 0) ),
35
35
}
36
36
37
37
@@ -41,15 +41,15 @@ def __getattr__(name):
41
41
42
42
from sphinx.deprecation import _deprecation_warning
43
43
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 )
46
46
return deprecated_object
47
47
"""
48
48
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
53
53
else :
54
54
raise RuntimeError (f'removal version { remove !r} is invalid!' )
55
55
0 commit comments