From b1edfbe29621cf9cfd9ac0e92f1e6fe4d9390c27 Mon Sep 17 00:00:00 2001 From: John Evans Date: Wed, 25 Sep 2013 10:34:16 -0400 Subject: [PATCH] When working with 3.3, really should catch both IOError and OSError. On 2.7, the mac seems to issue an IOError, other platforms an OSError. Just catch both. #123 --- glymur/test/test_jp2k.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index 2519246..ec174bf 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -146,7 +146,7 @@ class TestJp2k_2_0(unittest.TestCase): def test_extra_components_on_v2(self): """must error out in 1.x with extra components.""" # Extra components seems to require 2.0+. Verify that we error out. - with self.assertRaises(OSError): + with self.assertRaises((IOError, OSError)): with tempfile.NamedTemporaryFile(suffix='.jp2') as tfile: j = Jp2k(tfile.name, 'wb') data = np.zeros((128, 128, 4), dtype=np.uint8)