mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-31 23:44:14 +03:00
Removed ignores
This commit is contained in:
parent
b64847e07f
commit
ded404507b
|
@ -22,7 +22,6 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from typing import Union, cast
|
|
||||||
|
|
||||||
from . import Image
|
from . import Image
|
||||||
|
|
||||||
|
@ -70,15 +69,15 @@ def grab(
|
||||||
left, top, right, bottom = bbox
|
left, top, right, bottom = bbox
|
||||||
im = im.crop((left - x0, top - y0, right - x0, bottom - y0))
|
im = im.crop((left - x0, top - y0, right - x0, bottom - y0))
|
||||||
return im
|
return im
|
||||||
xdisplay = cast(Union[str, None], xdisplay) # type: ignore[redundant-cast, unused-ignore]
|
display_name: str | None = xdisplay
|
||||||
try:
|
try:
|
||||||
if not Image.core.HAVE_XCB:
|
if not Image.core.HAVE_XCB:
|
||||||
msg = "Pillow was built without XCB support"
|
msg = "Pillow was built without XCB support"
|
||||||
raise OSError(msg)
|
raise OSError(msg)
|
||||||
size, data = Image.core.grabscreen_x11(xdisplay)
|
size, data = Image.core.grabscreen_x11(display_name)
|
||||||
except OSError:
|
except OSError:
|
||||||
if (
|
if (
|
||||||
xdisplay is None
|
display_name is None
|
||||||
and sys.platform not in ("darwin", "win32")
|
and sys.platform not in ("darwin", "win32")
|
||||||
and shutil.which("gnome-screenshot")
|
and shutil.which("gnome-screenshot")
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user