summaryrefslogtreecommitdiff
path: root/sphinx/ext/graphviz.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-22 22:54:15 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-22 22:54:15 +0900
commitdc44b0d2a9c52b5c12843cb1a0a6e0aea3c7f4d2 (patch)
treeee090ebec55c1aa6c5b9e19bfbad1ae0bbfb8abe /sphinx/ext/graphviz.py
parent490e4aed4145659dab000e86269bd7a3dc686318 (diff)
parentb4fab4bf115af984a82b9c509decc0d1c5fe1c41 (diff)
downloadsphinx-git-dc44b0d2a9c52b5c12843cb1a0a6e0aea3c7f4d2.tar.gz
Merge branch 'master' into HEAD
Diffstat (limited to 'sphinx/ext/graphviz.py')
-rw-r--r--sphinx/ext/graphviz.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index 1a56536de..f7f97213c 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -10,7 +10,6 @@
:license: BSD, see LICENSE for details.
"""
-import codecs
import posixpath
import re
from hashlib import sha1
@@ -142,7 +141,7 @@ class Graphviz(SphinxDirective):
rel_filename, filename = self.env.relfn2path(argument)
self.env.note_dependency(rel_filename)
try:
- with codecs.open(filename, 'r', 'utf-8') as fp: # type: ignore
+ with open(filename, 'r', encoding='utf-8') as fp: # type: ignore
dotcode = fp.read()
except (IOError, OSError):
return [document.reporter.warning(
@@ -309,7 +308,7 @@ def render_dot_html(self, node, code, options, prefix='graphviz',
self.body.append('<p class="warning">%s</p>' % alt)
self.body.append('</object></div>\n')
else:
- with codecs.open(outfn + '.map', 'r', encoding='utf-8') as mapfile: # type: ignore
+ with open(outfn + '.map', 'r', encoding='utf-8') as mapfile: # type: ignore
imgmap = ClickableMapDefinition(outfn + '.map', mapfile.read(), dot=code)
if imgmap.clickable:
# has a map