Core:Loader fix crash on invalid filehandle and img_pygame: fix

indentation closes #265
This commit is contained in:
qua-non 2012-12-09 07:51:28 +05:30
parent 9d734e9b10
commit 75d1ca2624
2 changed files with 5 additions and 2 deletions

View File

@ -59,7 +59,7 @@ class ImageLoaderPygame(ImageLoaderBase):
Logger.warning(
'Image: Unable to convert image %r to rgba (was %r)' %
(filename, im.fmt))
raise
raise
im = imc
# update internals

View File

@ -183,7 +183,10 @@ class LoaderBase(object):
except Exception:
Logger.exception('Failed to load image <%s>' % filename)
# close file when remote file not found or download error
close(_out_osfd)
try:
close(_out_osfd)
except OSError:
pass
return self.error_image
finally:
if _out_filename != '':