mirror of https://github.com/kivy/kivy.git
Core:Loader fix crash on invalid filehandle and img_pygame: fix
indentation closes #265
This commit is contained in:
parent
9d734e9b10
commit
75d1ca2624
|
@ -59,7 +59,7 @@ class ImageLoaderPygame(ImageLoaderBase):
|
||||||
Logger.warning(
|
Logger.warning(
|
||||||
'Image: Unable to convert image %r to rgba (was %r)' %
|
'Image: Unable to convert image %r to rgba (was %r)' %
|
||||||
(filename, im.fmt))
|
(filename, im.fmt))
|
||||||
raise
|
raise
|
||||||
im = imc
|
im = imc
|
||||||
|
|
||||||
# update internals
|
# update internals
|
||||||
|
|
|
@ -183,7 +183,10 @@ class LoaderBase(object):
|
||||||
except Exception:
|
except Exception:
|
||||||
Logger.exception('Failed to load image <%s>' % filename)
|
Logger.exception('Failed to load image <%s>' % filename)
|
||||||
# close file when remote file not found or download error
|
# close file when remote file not found or download error
|
||||||
close(_out_osfd)
|
try:
|
||||||
|
close(_out_osfd)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
return self.error_image
|
return self.error_image
|
||||||
finally:
|
finally:
|
||||||
if _out_filename != '':
|
if _out_filename != '':
|
||||||
|
|
Loading…
Reference in New Issue