1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 18:07:37 +03:00

getint() should return 0 for unset

This commit is contained in:
Jonathan Harris 2019-09-30 04:01:29 +01:00 committed by Athanasius
parent 4b69a21c89
commit 9eb4dbd93e

View File

@ -169,20 +169,20 @@ class Config(object):
def get(self, key):
try:
(value, typ) = QueryValueEx(self.hkey, key)
if typ not in [REG_SZ, REG_MULTI_SZ]:
raise ValueError()
return value
except:
return None
if typ not in [REG_SZ, REG_MULTI_SZ]:
return None
return value
def getint(self, key):
try:
(value, typ) = QueryValueEx(self.hkey, key)
except:
return None
if typ != REG_DWORD:
return None
raise ValueError()
return value
except:
return 0
def set(self, key, val):
if isinstance(val, str):