summaryrefslogtreecommitdiff
path: root/sphinx/util/cfamily.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/cfamily.py')
-rw-r--r--sphinx/util/cfamily.py33
1 files changed, 8 insertions, 25 deletions
diff --git a/sphinx/util/cfamily.py b/sphinx/util/cfamily.py
index 1549fbf75..2be2e390f 100644
--- a/sphinx/util/cfamily.py
+++ b/sphinx/util/cfamily.py
@@ -9,7 +9,6 @@
"""
import re
-import warnings
from copy import deepcopy
from typing import Any, Callable, List, Match, Optional, Pattern, Tuple, Union
@@ -17,7 +16,6 @@ from docutils import nodes
from docutils.nodes import TextElement
from sphinx.config import Config
-from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.util import logging
logger = logging.getLogger(__name__)
@@ -85,12 +83,7 @@ def verify_description_mode(mode: str) -> None:
class NoOldIdError(Exception):
# Used to avoid implementing unneeded id generation for old id schemes.
- @property
- def description(self) -> str:
- warnings.warn('%s.description is deprecated. '
- 'Coerce the instance to a string instead.' % self.__class__.__name__,
- RemovedInSphinx40Warning, stacklevel=2)
- return str(self)
+ pass
class ASTBaseBase:
@@ -105,7 +98,7 @@ class ASTBaseBase:
return False
return True
- __hash__ = None # type: Callable[[], int]
+ __hash__: Callable[[], int] = None
def clone(self) -> Any:
return deepcopy(self)
@@ -213,21 +206,11 @@ class ASTBaseParenExprList(ASTBaseBase):
################################################################################
class UnsupportedMultiCharacterCharLiteral(Exception):
- @property
- def decoded(self) -> str:
- warnings.warn('%s.decoded is deprecated. '
- 'Coerce the instance to a string instead.' % self.__class__.__name__,
- RemovedInSphinx40Warning, stacklevel=2)
- return str(self)
+ pass
class DefinitionError(Exception):
- @property
- def description(self) -> str:
- warnings.warn('%s.description is deprecated. '
- 'Coerce the instance to a string instead.' % self.__class__.__name__,
- RemovedInSphinx40Warning, stacklevel=2)
- return str(self)
+ pass
class BaseParser:
@@ -240,9 +223,9 @@ class BaseParser:
self.pos = 0
self.end = len(self.definition)
- self.last_match = None # type: Match
- self._previous_state = (0, None) # type: Tuple[int, Match]
- self.otherErrors = [] # type: List[DefinitionError]
+ self.last_match: Match = None
+ self._previous_state: Tuple[int, Match] = (0, None)
+ self.otherErrors: List[DefinitionError] = []
# in our tests the following is set to False to capture bad parsing
self.allowFallbackExpressionParsing = True
@@ -373,7 +356,7 @@ class BaseParser:
# TODO: add handling of string literals and similar
brackets = {'(': ')', '[': ']', '{': '}'}
startPos = self.pos
- symbols = [] # type: List[str]
+ symbols: List[str] = []
while not self.eof:
if len(symbols) == 0 and self.current_char in end:
break