do not cast unicode_literals string to str()

It throws off unicode_check and is wasteful anyway...
This commit is contained in:
Eli Schwartz 2019-09-02 22:53:17 -04:00 committed by Kovid Goyal
parent c05fdfa1c6
commit db9ebeb2d5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -121,9 +121,9 @@ def convert_to_registry_data(value, has_expansions=False):
return buf, winreg.REG_MULTI_SZ, len(buf) * 2
if isinstance(value, numbers.Integral):
try:
raw, dtype = struct.pack(str('L'), value), winreg.REG_DWORD
raw, dtype = struct.pack('L', value), winreg.REG_DWORD
except struct.error:
raw = struct.pack(str('Q'), value), win32con.REG_QWORD
raw = struct.pack('Q', value), win32con.REG_QWORD
buf = ctypes.create_string_buffer(raw)
return buf, dtype, len(buf)
if isinstance(value, bytes):