This commit is contained in:
Kovid Goyal 2016-05-11 11:35:03 +05:30
parent 384678163a
commit a3da57a7b1

View File

@ -36,7 +36,7 @@ def get_hwnd(widget=None):
def serialize_hwnd(hwnd): def serialize_hwnd(hwnd):
if hwnd is None: if hwnd is None:
return b'' return b''
return struct.pack(b'=' + (b'B4sQ' if is64bit else b'I'), 4, b'HWND', int(hwnd)) return struct.pack(b'=B4s' + (b'Q' if is64bit else b'I'), 4, b'HWND', int(hwnd))
def serialize_binary(key, val): def serialize_binary(key, val):
key = key.encode('ascii') if not isinstance(key, bytes) else key key = key.encode('ascii') if not isinstance(key, bytes) else key