summaryrefslogtreecommitdiff
path: root/sphinx/ext/autosummary/generate.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-12-11 06:46:04 -0800
committerJon Dufresne <jon.dufresne@gmail.com>2018-12-11 06:50:20 -0800
commit8bb73c9fd3555deb83f01e1d18fa10c563202f78 (patch)
treeaffde9d2c1580e38138c860cd298b384cfde5b96 /sphinx/ext/autosummary/generate.py
parent689b9ffd047b12b0fe30e2b25bbc3f50f4756785 (diff)
downloadsphinx-git-8bb73c9fd3555deb83f01e1d18fa10c563202f78.tar.gz
Simplify open() call by removing default mode
The open() function opens files in read-only text mode by default. Drop the mode argument to be slightly simpler and more idiomatic. https://docs.python.org/3/library/functions.html#open > The default mode is 'r' (open for reading text, synonym of 'rt').
Diffstat (limited to 'sphinx/ext/autosummary/generate.py')
-rw-r--r--sphinx/ext/autosummary/generate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index 163e23e9f..5e51e43ac 100644
--- a/sphinx/ext/autosummary/generate.py
+++ b/sphinx/ext/autosummary/generate.py
@@ -248,7 +248,7 @@ def find_autosummary_in_files(filenames):
"""
documented = [] # type: List[Tuple[unicode, unicode, unicode]]
for filename in filenames:
- with open(filename, 'r', encoding='utf-8', # type: ignore
+ with open(filename, encoding='utf-8', # type: ignore
errors='ignore') as f:
lines = f.read().splitlines()
documented.extend(find_autosummary_in_lines(lines, filename=filename))