From e9a6a96053b9801900c8122e57632f1febf7136e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 2 Dec 2015 16:23:49 +1100 Subject: [PATCH] Specified exception type --- PIL/EpsImagePlugin.py | 2 +- PIL/GifImagePlugin.py | 2 +- PIL/IptcImagePlugin.py | 2 +- PIL/JpegImagePlugin.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PIL/EpsImagePlugin.py b/PIL/EpsImagePlugin.py index fb5bf7ffe..ca3c169bd 100644 --- a/PIL/EpsImagePlugin.py +++ b/PIL/EpsImagePlugin.py @@ -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 diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py index 83169bf21..391ddd332 100644 --- a/PIL/GifImagePlugin.py +++ b/PIL/GifImagePlugin.py @@ -518,7 +518,7 @@ def _save_netpbm(im, fp, filename): try: os.unlink(file) - except: + except OSError: pass diff --git a/PIL/IptcImagePlugin.py b/PIL/IptcImagePlugin.py index b5aa84bad..56d1de424 100644 --- a/PIL/IptcImagePlugin.py +++ b/PIL/IptcImagePlugin.py @@ -179,7 +179,7 @@ class IptcImageFile(ImageFile.ImageFile): finally: try: os.unlink(outfile) - except: + except OSError: pass diff --git a/PIL/JpegImagePlugin.py b/PIL/JpegImagePlugin.py index 577951961..8d25ffe66 100644 --- a/PIL/JpegImagePlugin.py +++ b/PIL/JpegImagePlugin.py @@ -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