From 44b82e4513529fd20479169eba22366815f7821c Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 25 Jun 2024 21:40:30 +1000 Subject: [PATCH] Use more specific error --- Tests/test_file_jpeg2k.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/test_file_jpeg2k.py b/Tests/test_file_jpeg2k.py index ed7ea4fcf..c6f1e0f52 100644 --- a/Tests/test_file_jpeg2k.py +++ b/Tests/test_file_jpeg2k.py @@ -337,7 +337,7 @@ def test_issue_6194() -> None: def test_unbound_local() -> None: # prepatch, a malformed jp2 file could cause an UnboundLocalError exception. - with pytest.raises(OSError): + with pytest.raises(UnidentifiedImageError): with Image.open("Tests/images/unbound_variable.jp2"): pass