Skip to content

Commit

Permalink
Python 2.6 is literally the worst version of Python.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbasta committed Feb 14, 2013
1 parent aca5930 commit 1762878
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions appvalidator/testcases/webappbase.py
Expand Up @@ -246,9 +246,10 @@ def test_icon(err, data, url, size):
try:
name = url.split('/')[-1]
data.seek(0) # Rewind the StringIO
with gzip.GzipFile(name, 'rb', fileobj=data) as gzf:
icon = Image.open(gzf)
icon.verify()
gzf = gzip.GzipFile(name, 'rb', fileobj=data)
icon = Image.open(gzf)
icon.verify()

except IOError, e:
err.error(
err_id=("resources", "icon", "ioerror"),
Expand All @@ -257,6 +258,9 @@ def test_icon(err, data, url, size):
"may contain invalid or corrupt data. Icons may "
"be only JPG or PNG images.",
"%dpx icon (%s)" % (size, url)])
else:
if gzf:
gzf.close()
else:
width, height = icon.size
if width != height:
Expand Down

0 comments on commit 1762878

Please sign in to comment.