summaryrefslogtreecommitdiff
path: root/sphinx/util/docutils.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-12 17:32:01 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-12 17:32:04 +0900
commit05036b9578f3743ee568ccd0dd4e35744b2e773c (patch)
tree33cc720b42e80f2ce55cbf458344a86df13ccc57 /sphinx/util/docutils.py
parentbf491cff2f9464fb61cebeba5919196b046dea62 (diff)
downloadsphinx-git-05036b9578f3743ee568ccd0dd4e35744b2e773c.tar.gz
Remove SphinxTranslator.get_settings()
It was introduced to fake its type information and make mypy silent. But the warnings had came from wrong typing of docutils-stubs. (see https://github.com/tk0miya/docutils-stubs/pull/28) After the fix, the helper method is not needed for us. So this removes it right away.
Diffstat (limited to 'sphinx/util/docutils.py')
-rw-r--r--sphinx/util/docutils.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/sphinx/util/docutils.py b/sphinx/util/docutils.py
index cdf5f2e19..aa0b737eb 100644
--- a/sphinx/util/docutils.py
+++ b/sphinx/util/docutils.py
@@ -398,16 +398,7 @@ class SphinxTranslator(nodes.NodeVisitor):
super(SphinxTranslator, self).__init__(document)
self.builder = builder
self.config = builder.config
-
- def get_settings(self):
- # type: () -> Any
- """Get settings object with type safe.
-
- .. note:: It is hard to check types for settings object because it's attributes
- are added dynamically. This method avoids the type errors through
- imitating it's type as Any.
- """
- return self.document.settings
+ self.settings = document.settings
# cache a vanilla instance of nodes.document