diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-13 01:33:14 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 02:42:42 +0900 |
commit | 53917f228f9bfbb4607b6441119baeb129869b93 (patch) | |
tree | 4e87e2e8a2fc209f74a3675dc0f079bda78b6a3b /sphinx/ext/autosummary/generate.py | |
parent | f8a2e7aa8af27b9d90330d9d795ef20fe0158001 (diff) | |
download | sphinx-git-53917f228f9bfbb4607b6441119baeb129869b93.tar.gz |
Move to py3 mode for mypy (and remove many "type: ignore" comments)
Diffstat (limited to 'sphinx/ext/autosummary/generate.py')
-rw-r--r-- | sphinx/ext/autosummary/generate.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index 5e51e43ac..04ba43d94 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -228,7 +228,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst', ns['underline'] = len(name) * '=' rendered = template.render(**ns) - f.write(rendered) # type: ignore + f.write(rendered) # descend recursively to new files if new_files: @@ -248,8 +248,7 @@ def find_autosummary_in_files(filenames): """ documented = [] # type: List[Tuple[unicode, unicode, unicode]] for filename in filenames: - with open(filename, encoding='utf-8', # type: ignore - errors='ignore') as f: + with open(filename, encoding='utf-8', errors='ignore') as f: lines = f.read().splitlines() documented.extend(find_autosummary_in_lines(lines, filename=filename)) return documented @@ -264,7 +263,7 @@ def find_autosummary_in_docstring(name, module=None, filename=None): try: real_name, obj, parent, modname = import_by_name(name) lines = pydoc.getdoc(obj).splitlines() - return find_autosummary_in_lines(lines, module=name, filename=filename) # type: ignore + return find_autosummary_in_lines(lines, module=name, filename=filename) except AttributeError: pass except ImportError as e: |