aboutsummaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-09-06 20:11:46 +0100
committerMichael Williamson <mike@zwobble.org>2017-09-06 20:11:46 +0100
commitcd2c4e8a8ee25c73e9e8cadbd4b11e4100f2e03a (patch)
tree64699f0cc2e426d3c552e59dbaa535accd52c54f /recipes
parent944e68cd850cba6757ba4bc1e5b1e426a7fc1f02 (diff)
Use "with" to open file in example
Diffstat (limited to 'recipes')
-rw-r--r--recipes/wmf_images.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/recipes/wmf_images.py b/recipes/wmf_images.py
index 3b38bce..5fb3fe1 100644
--- a/recipes/wmf_images.py
+++ b/recipes/wmf_images.py
@@ -21,9 +21,8 @@ import tempfile
# image = libreoffice_wmf_conversion(image, post_process=imagemagick_trim)
# return mammoth.images.data_uri(image)
#
-#
-# fileobj = open("document.docx", "rb")
-# result = mammoth.convert_to_html(fileobj, convert_image=convert_image)
+# with open("document.docx", "rb") as fileobj:
+# result = mammoth.convert_to_html(fileobj, convert_image=convert_image)
_wmf_extensions = {