diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-11 04:57:20 -0700 |
|---|---|---|
| committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-11 05:45:36 -0700 |
| commit | 02fea029bfc5bfd64e43de9e810aef2dd3c8cb2c (patch) | |
| tree | 8460d233e013fe774e8e9d5a2cc3e3ef2392a37d /sphinx/builders/applehelp.py | |
| parent | 844a3a5c226ff8891a1ce139f10ac92157c75da5 (diff) | |
| download | sphinx-git-02fea029bfc5bfd64e43de9e810aef2dd3c8cb2c.tar.gz | |
Prefer builtin open() over io.open() and codecs.open()
In Python3, the functions io.open() is an alias of the builtin open()
and codecs.open() is functionally equivalent. To reduce indirection,
number of imports, and number of patterns, always prefer the builtin.
https://docs.python.org/3/library/io.html#high-level-module-interface
> io.open()
>
> This is an alias for the builtin open() function.
Diffstat (limited to 'sphinx/builders/applehelp.py')
| -rw-r--r-- | sphinx/builders/applehelp.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sphinx/builders/applehelp.py b/sphinx/builders/applehelp.py index 79d57210c..56e9bd6c0 100644 --- a/sphinx/builders/applehelp.py +++ b/sphinx/builders/applehelp.py @@ -10,7 +10,6 @@ """ from __future__ import print_function -import codecs import pipes import plistlib import shlex @@ -193,7 +192,7 @@ class AppleHelpBuilder(StandaloneHTMLBuilder): # Build the access page logger.info(bold(__('building access page...')), nonl=True) - with codecs.open(path.join(language_dir, '_access.html'), 'w') as f: # type: ignore + with open(path.join(language_dir, '_access.html'), 'w') as f: f.write(access_page_template % { 'toc': htmlescape(toc, quote=True), 'title': htmlescape(self.config.applehelp_title) |
