Skip to content

Commit eeb494a

Browse files
committed
Fix formatting
1 parent 722283e commit eeb494a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Tests/test_imagegrab.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def test_grab_x11(self) -> None:
4040

4141
@pytest.mark.skipif(Image.core.HAVE_XCB, reason="tests missing XCB")
4242
def test_grab_no_xcb(self) -> None:
43-
if sys.platform not in ("win32", "darwin") and not shutil.which("gnome-screenshot") and not shutil.which('spectacle'):
43+
if (
44+
sys.platform not in ("win32", "darwin")
45+
and not shutil.which("gnome-screenshot")
46+
and not shutil.which("spectacle")
47+
):
4448
with pytest.raises(OSError) as e:
4549
ImageGrab.grab()
4650
assert str(e.value).startswith("Pillow was built without XCB support")

src/PIL/ImageGrab.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ def grab(
7777
raise OSError(msg)
7878
size, data = Image.core.grabscreen_x11(display_name)
7979
except OSError:
80-
if (
81-
display_name is None
82-
and sys.platform not in ("darwin", "win32")
83-
):
80+
if display_name is None and sys.platform not in ("darwin", "win32"):
8481
fh, filepath = tempfile.mkstemp(".png")
8582
os.close(fh)
8683
if shutil.which("gnome-screenshot"):
@@ -89,7 +86,7 @@ def grab(
8986
subprocess.call(["spectacle", "-n", "-b", "-f", "-o", filepath])
9087
else:
9188
os.unlink(filepath)
92-
raise
89+
raise
9390
im = Image.open(filepath)
9491
im.load()
9592
os.unlink(filepath)

0 commit comments

Comments
 (0)