1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-23 04:10:29 +03:00

getint() should return 0 for unset

This commit is contained in:
Jonathan Harris 2019-09-30 04:01:29 +01:00
parent cf5c1e0bbc
commit 2ed09c75fd

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)
if typ != REG_DWORD:
raise ValueError()
return value
except:
return None
if typ != REG_DWORD:
return None
return value
return 0
def set(self, key, val):
if isinstance(val, str):