Remove vdata check for none

This was moved to the _to_unicode function
This commit is contained in:
twangboy 2018-03-06 12:30:10 -07:00
parent 498a2c6873
commit e2bfb848b1
No known key found for this signature in database
GPG Key ID: 93FF3BDEB278C9EB

View File

@ -532,20 +532,18 @@ def set_value(hive,
# int will automatically become long on 64bit numbers
# https://www.python.org/dev/peps/pep-0237/
local_vdata = None
if vdata is not None:
# String Types to Unicode
if vtype_value in [win32con.REG_SZ, win32con.REG_EXPAND_SZ]:
local_vdata = _to_unicode(vdata)
# Don't touch binary...
elif vtype_value == win32con.REG_BINARY:
local_vdata = vdata
# Make sure REG_MULTI_SZ is a list of strings
elif vtype_value == win32con.REG_MULTI_SZ:
local_vdata = [_to_unicode(i) for i in vdata]
# Everything else is int
else:
local_vdata = int(vdata)
# String Types to Unicode
if vtype_value in [win32con.REG_SZ, win32con.REG_EXPAND_SZ]:
local_vdata = _to_unicode(vdata)
# Don't touch binary...
elif vtype_value == win32con.REG_BINARY:
local_vdata = vdata
# Make sure REG_MULTI_SZ is a list of strings
elif vtype_value == win32con.REG_MULTI_SZ:
local_vdata = [_to_unicode(i) for i in vdata]
# Everything else is int
else:
local_vdata = int(vdata)
if volatile:
create_options = registry.opttype['REG_OPTION_VOLATILE']