Skip to content

Commit

Permalink
Removed ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 22, 2024
1 parent b64847e commit ddec690
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/PIL/ImageGrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import subprocess
import sys
import tempfile
from typing import Union, cast

from . import Image

Expand Down Expand Up @@ -70,15 +69,15 @@ def grab(
left, top, right, bottom = bbox
im = im.crop((left - x0, top - y0, right - x0, bottom - y0))
return im
xdisplay = cast(Union[str, None], xdisplay) # type: ignore[redundant-cast, unused-ignore]
display_name: str | None = xdisplay
try:
if not Image.core.HAVE_XCB:
msg = "Pillow was built without XCB support"
raise OSError(msg)
size, data = Image.core.grabscreen_x11(xdisplay)
size, data = Image.core.grabscreen_x11(display_name)
except OSError:
if (
xdisplay is None
display_name is None
and sys.platform not in ("darwin", "win32")
and shutil.which("gnome-screenshot")
):
Expand Down

0 comments on commit ddec690

Please sign in to comment.