diff --git a/Tests/test_imagegrab.py b/Tests/test_imagegrab.py index 07cb69719d9..180682c6415 100644 --- a/Tests/test_imagegrab.py +++ b/Tests/test_imagegrab.py @@ -35,7 +35,7 @@ def test_grab_x11(self) -> None: ImageGrab.grab() ImageGrab.grab(xdisplay="") - except OSError as e: + except (OSError, subprocess.CalledProcessError) as e: pytest.skip(str(e)) @pytest.mark.skipif(Image.core.HAVE_XCB, reason="tests missing XCB")