mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-28 01:33:21 +03:00
Fix formatting
This commit is contained in:
parent
722283e819
commit
eeb494abf7
|
@ -40,7 +40,11 @@ class TestImageGrab:
|
|||
|
||||
@pytest.mark.skipif(Image.core.HAVE_XCB, reason="tests missing XCB")
|
||||
def test_grab_no_xcb(self) -> None:
|
||||
if sys.platform not in ("win32", "darwin") and not shutil.which("gnome-screenshot") and not shutil.which('spectacle'):
|
||||
if (
|
||||
sys.platform not in ("win32", "darwin")
|
||||
and not shutil.which("gnome-screenshot")
|
||||
and not shutil.which("spectacle")
|
||||
):
|
||||
with pytest.raises(OSError) as e:
|
||||
ImageGrab.grab()
|
||||
assert str(e.value).startswith("Pillow was built without XCB support")
|
||||
|
|
|
@ -77,10 +77,7 @@ def grab(
|
|||
raise OSError(msg)
|
||||
size, data = Image.core.grabscreen_x11(display_name)
|
||||
except OSError:
|
||||
if (
|
||||
display_name is None
|
||||
and sys.platform not in ("darwin", "win32")
|
||||
):
|
||||
if display_name is None and sys.platform not in ("darwin", "win32"):
|
||||
fh, filepath = tempfile.mkstemp(".png")
|
||||
os.close(fh)
|
||||
if shutil.which("gnome-screenshot"):
|
||||
|
@ -89,7 +86,7 @@ def grab(
|
|||
subprocess.call(["spectacle", "-n", "-b", "-f", "-o", filepath])
|
||||
else:
|
||||
os.unlink(filepath)
|
||||
raise
|
||||
raise
|
||||
im = Image.open(filepath)
|
||||
im.load()
|
||||
os.unlink(filepath)
|
||||
|
|
Loading…
Reference in New Issue
Block a user