Skip to content

Commit

Permalink
Use tuples
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
radarhere and hugovk authored Aug 22, 2023
1 parent 8b14a67 commit 9c3bc70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PIL/ImageGrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down

0 comments on commit 9c3bc70

Please sign in to comment.