Deprecate sphinx.io.FiletypeNotFoundError and get_filetype()

This commit is contained in:
Takeshi KOMIYA 2019-12-16 01:38:17 +09:00
parent 2f768cf5a7
commit 00c30679cf
3 changed files with 25 additions and 1 deletions

View File

@ -10,6 +10,9 @@ Incompatible changes
Deprecated
----------
* ``sphinx.io.FiletypeNotFoundError``
* ``sphinx.io.get_filetype()``
Features added
--------------

View File

@ -26,6 +26,16 @@ The following is a list of deprecated interfaces.
- (will be) Removed
- Alternatives
* - ``sphinx.io.FiletypeNotFoundError``
- 2.4
- 4.0
- ``sphinx.errors.FiletypeNotFoundError``
* - ``sphinx.io.get_filetype()``
- 2.4
- 4.0
- ``sphinx.util.get_filetype()``
* - ``sphinx.builders.gettext.POHEADER``
- 2.3
- 4.0

View File

@ -19,7 +19,10 @@ from docutils.statemachine import StringList, string2lines
from docutils.transforms.references import DanglingReferences
from docutils.writers import UnfilteredWriter
from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning
from sphinx.deprecation import (
RemovedInSphinx30Warning, RemovedInSphinx40Warning, deprecated_alias
)
from sphinx.errors import FiletypeNotFoundError
from sphinx.transforms import (
AutoIndexUpgrader, DoctreeReadEvent, FigureAligner, SphinxTransformer
)
@ -335,3 +338,11 @@ def read_doc(app, env, filename):
pub.publish()
return pub.document
deprecated_alias('sphinx.io',
{
'FiletypeNotFoundError': FiletypeNotFoundError,
'get_filetype': get_filetype,
},
RemovedInSphinx40Warning)