Skip to content

Commit aedbc77

Browse files
authored
Merge pull request #6712 from radarhere/imagegrab
XCB will not be used by default on Linux if gnome-screenshot is present
2 parents 30dd02c + 6b286ed commit aedbc77

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tests/test_imagegrab.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import shutil
23
import subprocess
34
import sys
45

@@ -33,7 +34,9 @@ def test_grab_x11(self):
3334

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

0 commit comments

Comments
 (0)