diff --git a/setup.py b/setup.py index 0530cc4..0b8bdc1 100644 --- a/setup.py +++ b/setup.py @@ -63,10 +63,11 @@ def _read_value(path, name): subkey = _registry_path(path) if not reg_key_exists(HKEY_LOCAL_MACHINE, subkey): return {'Exists': False, 'Value': None} - if not reg_value_exists(HKEY_LOCAL_MACHINE, subkey, name): - return {'Exists': False, 'Value': None} + missing = object() with reg_openkey_noredir(HKEY_LOCAL_MACHINE, subkey) as key: - value = reg_getvalue(key, name) + value = reg_getvalue(key, name, default=missing) + if value is missing: + return {'Exists': False, 'Value': None} if value is None: raise RuntimeError('Registry value disappeared while it was being read: %s' % name) try: