summaryrefslogtreecommitdiff
path: root/sphinx/io.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/io.py')
-rw-r--r--sphinx/io.py30
1 files changed, 3 insertions, 27 deletions
diff --git a/sphinx/io.py b/sphinx/io.py
index f45d5bf5d..3469fcc3d 100644
--- a/sphinx/io.py
+++ b/sphinx/io.py
@@ -8,8 +8,8 @@
:license: BSD, see LICENSE for details.
"""
import codecs
-import warnings
-from typing import Any, List
+from typing import Any, List, Type
+from typing import TYPE_CHECKING
from docutils import nodes
from docutils.core import Publisher
@@ -22,9 +22,7 @@ from docutils.transforms import Transform
from docutils.transforms.references import DanglingReferences
from docutils.writers import UnfilteredWriter
-from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
from sphinx.environment import BuildEnvironment
-from sphinx.errors import FiletypeNotFoundError
from sphinx.transforms import (
AutoIndexUpgrader, DoctreeReadEvent, FigureAligner, SphinxTransformer
)
@@ -37,9 +35,7 @@ from sphinx.util import UnicodeDecodeErrorHandler
from sphinx.util.docutils import LoggingReporter
from sphinx.versioning import UIDTransform
-if False:
- # For type annotation
- from typing import Type # for python3.5.1
+if TYPE_CHECKING:
from sphinx.application import Sphinx
@@ -64,18 +60,6 @@ class SphinxBaseReader(standalone.Reader):
super().__init__(*args, **kwargs)
- @property
- def app(self) -> "Sphinx":
- warnings.warn('SphinxBaseReader.app is deprecated.',
- RemovedInSphinx40Warning, stacklevel=2)
- return self._app
-
- @property
- def env(self) -> BuildEnvironment:
- warnings.warn('SphinxBaseReader.env is deprecated.',
- RemovedInSphinx40Warning, stacklevel=2)
- return self._env
-
def setup(self, app: "Sphinx") -> None:
self._app = app # hold application object only for compatibility
self._env = app.env
@@ -220,11 +204,3 @@ def read_doc(app: "Sphinx", env: BuildEnvironment, filename: str) -> nodes.docum
pub.publish()
return pub.document
-
-
-deprecated_alias('sphinx.io',
- {
- 'FiletypeNotFoundError': FiletypeNotFoundError,
- 'get_filetype': get_filetype,
- },
- RemovedInSphinx40Warning)