simplify code

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
nulano 2020-05-28 12:07:53 +01:00 committed by GitHub
parent 1656edaf41
commit d2e23e386b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,10 +100,9 @@ def grabclipboard():
o = struct.unpack_from("I", data)[0]
if data[16] != 0:
files = data[o:].decode("utf-16le").split("\0")
return files[: files.index("")]
else:
files = data[o:].decode("mbcs").split("\0")
return files[: files.index("")]
return files[: files.index("")]
if isinstance(data, bytes):
import io