mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-04 20:03:20 +03:00
Check for equality rather than inequality
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
62da23bf83
commit
ef1f90fe1c
|
@ -134,7 +134,10 @@ def grabclipboard() -> Image.Image | list[str] | None:
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
o = struct.unpack_from("I", data)[0]
|
o = struct.unpack_from("I", data)[0]
|
||||||
files = data[o:].decode("mbcs" if data[16] == 0 else "utf-16le").split("\0")
|
if data[16] == 0:
|
||||||
|
files = data[o:].decode("mbcs").split("\0")
|
||||||
|
else:
|
||||||
|
files = data[o:].decode("utf-16le").split("\0")
|
||||||
return files[: files.index("")]
|
return files[: files.index("")]
|
||||||
if isinstance(data, bytes):
|
if isinstance(data, bytes):
|
||||||
data = io.BytesIO(data)
|
data = io.BytesIO(data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user