summaryrefslogtreecommitdiff
path: root/sphinx/writers
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-02 17:00:26 +0000
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-02 17:41:28 +0000
commitdc3f22a370b1a04d99591eddecfec835555feaf0 (patch)
treec086c3cf89912445674e4f74c0219738c759911e /sphinx/writers
parentb32841e153431ec02de31e9ec32e79ab3ac7d1c2 (diff)
downloadsphinx-git-dc3f22a370b1a04d99591eddecfec835555feaf0.tar.gz
Make MyPy happy
Diffstat (limited to 'sphinx/writers')
-rw-r--r--sphinx/writers/_html4.py6
-rw-r--r--sphinx/writers/html5.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/writers/_html4.py b/sphinx/writers/_html4.py
index 7aec4c892..3d36784ce 100644
--- a/sphinx/writers/_html4.py
+++ b/sphinx/writers/_html4.py
@@ -287,14 +287,14 @@ class HTML4Translator(SphinxTranslator, BaseTranslator):
else:
key = figtype
- if figure_id in self.builder.fignumbers.get(key, {}):
+ if figure_id in self.builder.fignumbers.get(key, {}): # type: ignore[has-type]
self.body.append('<span class="caption-number">')
prefix = self.config.numfig_format.get(figtype)
if prefix is None:
msg = __('numfig_format is not defined for %s') % figtype
logger.warning(msg)
else:
- numbers = self.builder.fignumbers[key][figure_id]
+ numbers = self.builder.fignumbers[key][figure_id] # type: ignore[has-type]
self.body.append(prefix % '.'.join(map(str, numbers)) + ' ')
self.body.append('</span>')
@@ -569,7 +569,7 @@ class HTML4Translator(SphinxTranslator, BaseTranslator):
self.context.append('</a>')
elif 'filename' in node:
atts['class'] += ' internal'
- atts['href'] = posixpath.join(self.builder.dlpath,
+ atts['href'] = posixpath.join(self.builder.dlpath, # type: ignore[has-type]
urllib.parse.quote(node['filename']))
self.body.append(self.starttag(node, 'a', '', **atts))
self.context.append('</a>')
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py
index edf8bdc23..7a62161b5 100644
--- a/sphinx/writers/html5.py
+++ b/sphinx/writers/html5.py
@@ -293,14 +293,14 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
else:
key = figtype
- if figure_id in self.builder.fignumbers.get(key, {}):
+ if figure_id in self.builder.fignumbers.get(key, {}): # type: ignore[has-type]
self.body.append('<span class="caption-number">')
prefix = self.config.numfig_format.get(figtype)
if prefix is None:
msg = __('numfig_format is not defined for %s') % figtype
logger.warning(msg)
else:
- numbers = self.builder.fignumbers[key][figure_id]
+ numbers = self.builder.fignumbers[key][figure_id] # type: ignore[has-type]
self.body.append(prefix % '.'.join(map(str, numbers)) + ' ')
self.body.append('</span>')
@@ -544,7 +544,7 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
self.context.append('</a>')
elif 'filename' in node:
atts['class'] += ' internal'
- atts['href'] = posixpath.join(self.builder.dlpath,
+ atts['href'] = posixpath.join(self.builder.dlpath, # type: ignore[has-type]
urllib.parse.quote(node['filename']))
self.body.append(self.starttag(node, 'a', '', **atts))
self.context.append('</a>')