mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +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:
|
try:
|
||||||
import cffi
|
import cffi
|
||||||
HAS_CFFI = True
|
HAS_CFFI = True
|
||||||
except:
|
except ImportError:
|
||||||
HAS_CFFI = False
|
HAS_CFFI = False
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ def Draw(im, mode=None):
|
||||||
# experimental access to the outline API
|
# experimental access to the outline API
|
||||||
try:
|
try:
|
||||||
Outline = Image.core.outline
|
Outline = Image.core.outline
|
||||||
except:
|
except AttributeError:
|
||||||
Outline = None
|
Outline = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from helper import unittest, PillowTestCase, hopper
|
||||||
try:
|
try:
|
||||||
import cffi
|
import cffi
|
||||||
from PIL import PyAccess
|
from PIL import PyAccess
|
||||||
except:
|
except ImportError:
|
||||||
# Skip in setUp()
|
# Skip in setUp()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class TestCffiPutPixel(TestImagePutPixel):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
import cffi
|
import cffi
|
||||||
except:
|
except ImportError:
|
||||||
self.skipTest("No cffi")
|
self.skipTest("No cffi")
|
||||||
|
|
||||||
def test_put(self):
|
def test_put(self):
|
||||||
|
@ -32,7 +32,7 @@ class TestCffiGetPixel(TestImageGetPixel):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
import cffi
|
import cffi
|
||||||
except:
|
except ImportError:
|
||||||
self.skipTest("No cffi")
|
self.skipTest("No cffi")
|
||||||
|
|
||||||
def test_get(self):
|
def test_get(self):
|
||||||
|
@ -45,7 +45,7 @@ class TestCffi(PillowTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
import cffi
|
import cffi
|
||||||
except:
|
except ImportError:
|
||||||
self.skipTest("No cffi")
|
self.skipTest("No cffi")
|
||||||
|
|
||||||
def _test_get_access(self, im):
|
def _test_get_access(self, im):
|
||||||
|
|
|
@ -159,7 +159,7 @@ class TestFileEps(PillowTestCase):
|
||||||
# check all the freaking line endings possible
|
# check all the freaking line endings possible
|
||||||
try:
|
try:
|
||||||
import StringIO
|
import StringIO
|
||||||
except:
|
except ImportError:
|
||||||
# don't skip, it skips everything in the parent test
|
# don't skip, it skips everything in the parent test
|
||||||
return
|
return
|
||||||
t = StringIO.StringIO(test_string)
|
t = StringIO.StringIO(test_string)
|
||||||
|
|
|
@ -4,7 +4,7 @@ from PIL import Image
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PIL import _webp
|
from PIL import _webp
|
||||||
except:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
# Skip in setUp()
|
# Skip in setUp()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ class TestFileWebpMetadata(PillowTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
from PIL import _webp
|
from PIL import _webp
|
||||||
except:
|
except ImportError:
|
||||||
self.skipTest('WebP support not installed')
|
self.skipTest('WebP support not installed')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,13 @@ class TestImageQt(PillowTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
from PyQt5.QtGui import QImage, qRgb, qRgba
|
from PyQt5.QtGui import QImage, qRgb, qRgba
|
||||||
except:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from PyQt4.QtGui import QImage, qRgb, qRgba
|
from PyQt4.QtGui import QImage, qRgb, qRgba
|
||||||
except:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from PySide.QtGui import QImage, qRgb, qRgba
|
from PySide.QtGui import QImage, qRgb, qRgba
|
||||||
except:
|
except ImportError:
|
||||||
self.skipTest('PyQt4 or 5 or PySide not installed')
|
self.skipTest('PyQt4 or 5 or PySide not installed')
|
||||||
|
|
||||||
def test_rgb(self):
|
def test_rgb(self):
|
||||||
|
|
|
@ -6,7 +6,7 @@ try:
|
||||||
|
|
||||||
from scipy import misc
|
from scipy import misc
|
||||||
HAS_SCIPY = True
|
HAS_SCIPY = True
|
||||||
except:
|
except ImportError:
|
||||||
HAS_SCIPY = False
|
HAS_SCIPY = False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user