Added FlushKey to make sure it's changes are saved to disk

This commit is contained in:
twangboy 2016-01-21 18:21:55 -07:00
parent cdc731b8c5
commit 23085ffbbb

View file

@ -361,6 +361,7 @@ def set_value(hive,
or vtype == registry.vtype['REG_BINARY']:
vdata = str(vdata)
_winreg.SetValueEx(handle, vname, 0, vtype, vdata)
_winreg.FlushKey(handle)
_winreg.CloseKey(handle)
return True
except (WindowsError, ValueError, TypeError) as exc: # pylint: disable=E0602