Skip to content

Commit

Permalink
Merge pull request #6712 from radarhere/imagegrab
Browse files Browse the repository at this point in the history
XCB will not be used by default on Linux if gnome-screenshot is present
  • Loading branch information
hugovk committed Nov 2, 2022
2 parents 30dd02c + 6b286ed commit aedbc77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Tests/test_imagegrab.py
@@ -1,4 +1,5 @@
import os
import shutil
import subprocess
import sys

Expand Down Expand Up @@ -33,7 +34,9 @@ def test_grab_x11(self):

@pytest.mark.skipif(Image.core.HAVE_XCB, reason="tests missing XCB")
def test_grab_no_xcb(self):
if sys.platform not in ("win32", "darwin"):
if sys.platform not in ("win32", "darwin") and not shutil.which(
"gnome-screenshot"
):
with pytest.raises(OSError) as e:
ImageGrab.grab()
assert str(e.value).startswith("Pillow was built without XCB support")
Expand Down

0 comments on commit aedbc77

Please sign in to comment.