Specified exception type

This commit is contained in:
Andrew Murray 2015-12-02 16:23:49 +11:00
parent 4ab0cbb5ba
commit e9a6a96053
4 changed files with 5 additions and 5 deletions

View File

@ -151,7 +151,7 @@ def Ghostscript(tile, size, fp, scale=1):
os.unlink(outfile)
if infile_temp:
os.unlink(infile_temp)
except:
except OSError:
pass
return im

View File

@ -518,7 +518,7 @@ def _save_netpbm(im, fp, filename):
try:
os.unlink(file)
except:
except OSError:
pass

View File

@ -179,7 +179,7 @@ class IptcImageFile(ImageFile.ImageFile):
finally:
try:
os.unlink(outfile)
except:
except OSError:
pass

View File

@ -379,7 +379,7 @@ class JpegImageFile(ImageFile.ImageFile):
finally:
try:
os.unlink(path)
except:
except OSError:
pass
self.mode = self.im.mode
@ -699,7 +699,7 @@ def _save_cjpeg(im, fp, filename):
subprocess.check_call(["cjpeg", "-outfile", filename, tempfile])
try:
os.unlink(tempfile)
except:
except OSError:
pass