aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin
diff options
context:
space:
mode:
authorAndrás Veres-Szentkirályi <vsza@vsza.hu>2013-02-21 11:29:24 +0100
committerJoar Wandborg <joar@wandborg.se>2013-02-22 22:24:29 +0100
commit9aff782ba7ae00644bf3cb95c4140f2a84bd1001 (patch)
tree238bf48e5dcd6355f60d1b6e7aa465bffae56f78 /mediagoblin
parent64376dc0bc10cdeb2597bcbc9130e83996a46692 (diff)
downloadmediagoblin-9aff782ba7ae00644bf3cb95c4140f2a84bd1001.tar.lz
mediagoblin-9aff782ba7ae00644bf3cb95c4140f2a84bd1001.tar.xz
mediagoblin-9aff782ba7ae00644bf3cb95c4140f2a84bd1001.zip
close file properly and remove unneeded variable
Diffstat (limited to 'mediagoblin')
-rw-r--r--mediagoblin/tools/exif.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py
index b8b4d9e6..b1da1833 100644
--- a/mediagoblin/tools/exif.py
+++ b/mediagoblin/tools/exif.py
@@ -73,16 +73,12 @@ def extract_exif(filename):
"""
Returns EXIF tags found in file at ``filename``
"""
- exif_tags = {}
-
try:
- image = open(filename)
- exif_tags = process_file(image, details=False)
+ with file(filename) as image:
+ return process_file(image, details=False)
except IOError:
raise BadMediaFail(_('Could not read the image file.'))
- return exif_tags
-
def clean_exif(exif):
'''