mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Specified exception types
This commit is contained in:
parent
e58a773c29
commit
26bcc443d1
|
@ -121,7 +121,7 @@ USE_CFFI_ACCESS = hasattr(sys, 'pypy_version_info')
|
|||
try:
|
||||
import cffi
|
||||
HAS_CFFI = True
|
||||
except:
|
||||
except ImportError:
|
||||
HAS_CFFI = False
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -4,7 +4,7 @@ from PIL import Image
|
|||
|
||||
try:
|
||||
from PIL import _webp
|
||||
except:
|
||||
except ImportError:
|
||||
pass
|
||||
# Skip in setUp()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -6,7 +6,7 @@ try:
|
|||
|
||||
from scipy import misc
|
||||
HAS_SCIPY = True
|
||||
except:
|
||||
except ImportError:
|
||||
HAS_SCIPY = False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user