summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-04-14 15:41:22 +0900
committerGitHub <noreply@github.com>2018-04-14 15:41:22 +0900
commit72762db255657f25e50dd14560b09e50bd5f0a67 (patch)
treee887ea9a0c14fff0f1cbc119c166d3f64e17135e
parent5433d5c03d2fa4cae8c233810bbb9af4e598f1db (diff)
parent779d25f7f19839bba8fecfcf464dc3c56cab91c5 (diff)
downloadsphinx-git-72762db255657f25e50dd14560b09e50bd5f0a67.tar.gz
Merge pull request #4839 from tk0miya/mypy-0.590
Fix mypy violations
-rw-r--r--sphinx/builders/_epub_base.py8
-rw-r--r--sphinx/theming.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/builders/_epub_base.py b/sphinx/builders/_epub_base.py
index 2c0c0f25e..04812c56f 100644
--- a/sphinx/builders/_epub_base.py
+++ b/sphinx/builders/_epub_base.py
@@ -707,9 +707,9 @@ class EpubBuilder(StandaloneHTMLBuilder):
"""
logger.info('writing %s file...', outname)
epub_filename = path.join(outdir, outname)
- with ZipFile(epub_filename, 'w', ZIP_DEFLATED) as epub: # type: ignore
- epub.write(path.join(outdir, 'mimetype'), 'mimetype', ZIP_STORED) # type: ignore
+ with ZipFile(epub_filename, 'w', ZIP_DEFLATED) as epub:
+ epub.write(path.join(outdir, 'mimetype'), 'mimetype', ZIP_STORED)
for filename in [u'META-INF/container.xml', u'content.opf', u'toc.ncx']:
- epub.write(path.join(outdir, filename), filename, ZIP_DEFLATED) # type: ignore
+ epub.write(path.join(outdir, filename), filename, ZIP_DEFLATED)
for filename in self.files:
- epub.write(path.join(outdir, filename), filename, ZIP_DEFLATED) # type: ignore
+ epub.write(path.join(outdir, filename), filename, ZIP_DEFLATED)
diff --git a/sphinx/theming.py b/sphinx/theming.py
index 33c4c76be..7a4720e0c 100644
--- a/sphinx/theming.py
+++ b/sphinx/theming.py
@@ -43,7 +43,7 @@ def extract_zip(filename, targetdir):
"""Extract zip file to target directory."""
ensuredir(targetdir)
- with ZipFile(filename) as archive: # type: ignore
+ with ZipFile(filename) as archive:
for name in archive.namelist():
if name.endswith('/'):
continue
@@ -155,7 +155,7 @@ def is_archived_theme(filename):
# type: (unicode) -> bool
"""Check the specified file is an archived theme file or not."""
try:
- with ZipFile(filename) as f: # type: ignore
+ with ZipFile(filename) as f:
return THEMECONF in f.namelist()
except Exception:
return False