summaryrefslogtreecommitdiff
path: root/sphinx/writers/html.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-03-01 09:15:26 +0100
committerGeorg Brandl <georg@python.org>2014-03-01 09:15:26 +0100
commit3092cab9ecf55ae6704f2b170d37ae00e91e4b3e (patch)
tree91430830ef7181de8729d34b5c901799442b292a /sphinx/writers/html.py
parent77635b8e09830edc1bebf50acae3a24e41172964 (diff)
parent4a5ac4a77184b23843f7252997644f203285945d (diff)
downloadsphinx-3092cab9ecf55ae6704f2b170d37ae00e91e4b3e.tar.gz
merge
Diffstat (limited to 'sphinx/writers/html.py')
-rw-r--r--sphinx/writers/html.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index 765ee905..13dd5d42 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -405,7 +405,10 @@ class HTMLTranslator(BaseTranslator):
node['width'] = str(im.size[0])
if 'height' not in node:
node['height'] = str(im.size[1])
- del im
+ try:
+ im.fp.close()
+ except Exception:
+ pass
BaseTranslator.visit_image(self, node)
def visit_toctree(self, node):