mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1375: fix ResourceWarnings with unclosed PIL images.
This commit is contained in:
@@ -402,7 +402,10 @@ class HTMLTranslator(BaseTranslator):
|
||||
node['width'] = str(im.size[0])
|
||||
if not node.has_key('height'):
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user