Skip to content

Commit ef1f90f

Browse files
radarherehugovk
andauthored
Check for equality rather than inequality
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 62da23b commit ef1f90f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PIL/ImageGrab.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ def grabclipboard() -> Image.Image | list[str] | None:
134134
import struct
135135

136136
o = struct.unpack_from("I", data)[0]
137-
files = data[o:].decode("mbcs" if data[16] == 0 else "utf-16le").split("\0")
137+
if data[16] == 0:
138+
files = data[o:].decode("mbcs").split("\0")
139+
else:
140+
files = data[o:].decode("utf-16le").split("\0")
138141
return files[: files.index("")]
139142
if isinstance(data, bytes):
140143
data = io.BytesIO(data)

0 commit comments

Comments
 (0)