From 9c3bc70f667e105c8bce5f34d8895ac5fcfbd02f Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:31:28 +1000 Subject: [PATCH] Use tuples Co-authored-by: Hugo van Kemenade --- src/PIL/ImageGrab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PIL/ImageGrab.py b/src/PIL/ImageGrab.py index 6dbdd0abc..43019f74a 100644 --- a/src/PIL/ImageGrab.py +++ b/src/PIL/ImageGrab.py @@ -147,7 +147,7 @@ def grabclipboard(): else: # Session type check failed session_type = None - if shutil.which("wl-paste") and session_type in ["wayland", None]: + if shutil.which("wl-paste") and session_type in ("wayland", None): output = subprocess.check_output(["wl-paste", "-l"]).decode() mimetypes = output.splitlines() if "image/png" in mimetypes: @@ -160,7 +160,7 @@ def grabclipboard(): args = ["wl-paste"] if mimetype: args.extend(["-t", mimetype]) - elif shutil.which("xclip") and session_type in ["x11", None]: + elif shutil.which("xclip") and session_type in ("x11", None): args = ["xclip", "-selection", "clipboard", "-t", "image/png", "-o"] else: msg = "wl-paste or xclip is required for ImageGrab.grabclipboard() on Linux"