Specified exception types

This commit is contained in:
Andrew Murray 2015-05-27 09:15:45 +10:00
parent e58a773c29
commit 26bcc443d1
8 changed files with 13 additions and 13 deletions

View File

@ -121,7 +121,7 @@ USE_CFFI_ACCESS = hasattr(sys, 'pypy_version_info')
try:
import cffi
HAS_CFFI = True
except:
except ImportError:
HAS_CFFI = False

View File

@ -301,7 +301,7 @@ def Draw(im, mode=None):
# experimental access to the outline API
try:
Outline = Image.core.outline
except:
except AttributeError:
Outline = None

View File

@ -3,7 +3,7 @@ from helper import unittest, PillowTestCase, hopper
try:
import cffi
from PIL import PyAccess
except:
except ImportError:
# Skip in setUp()
pass
@ -20,7 +20,7 @@ class TestCffiPutPixel(TestImagePutPixel):
def setUp(self):
try:
import cffi
except:
except ImportError:
self.skipTest("No cffi")
def test_put(self):
@ -32,7 +32,7 @@ class TestCffiGetPixel(TestImageGetPixel):
def setUp(self):
try:
import cffi
except:
except ImportError:
self.skipTest("No cffi")
def test_get(self):
@ -45,7 +45,7 @@ class TestCffi(PillowTestCase):
def setUp(self):
try:
import cffi
except:
except ImportError:
self.skipTest("No cffi")
def _test_get_access(self, im):

View File

@ -159,7 +159,7 @@ class TestFileEps(PillowTestCase):
# check all the freaking line endings possible
try:
import StringIO
except:
except ImportError:
# don't skip, it skips everything in the parent test
return
t = StringIO.StringIO(test_string)

View File

@ -4,7 +4,7 @@ from PIL import Image
try:
from PIL import _webp
except:
except ImportError:
pass
# Skip in setUp()

View File

@ -8,7 +8,7 @@ class TestFileWebpMetadata(PillowTestCase):
def setUp(self):
try:
from PIL import _webp
except:
except ImportError:
self.skipTest('WebP support not installed')
return

View File

@ -19,13 +19,13 @@ class TestImageQt(PillowTestCase):
def setUp(self):
try:
from PyQt5.QtGui import QImage, qRgb, qRgba
except:
except ImportError:
try:
from PyQt4.QtGui import QImage, qRgb, qRgba
except:
except ImportError:
try:
from PySide.QtGui import QImage, qRgb, qRgba
except:
except ImportError:
self.skipTest('PyQt4 or 5 or PySide not installed')
def test_rgb(self):

View File

@ -6,7 +6,7 @@ try:
from scipy import misc
HAS_SCIPY = True
except:
except ImportError:
HAS_SCIPY = False