mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-06 18:33:13 +03:00
getint() should return 0 for unset
This commit is contained in:
parent
4b69a21c89
commit
9eb4dbd93e
14
config.py
14
config.py
@ -169,20 +169,20 @@ class Config(object):
|
|||||||
def get(self, key):
|
def get(self, key):
|
||||||
try:
|
try:
|
||||||
(value, typ) = QueryValueEx(self.hkey, key)
|
(value, typ) = QueryValueEx(self.hkey, key)
|
||||||
|
if typ not in [REG_SZ, REG_MULTI_SZ]:
|
||||||
|
raise ValueError()
|
||||||
|
return value
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
if typ not in [REG_SZ, REG_MULTI_SZ]:
|
|
||||||
return None
|
|
||||||
return value
|
|
||||||
|
|
||||||
def getint(self, key):
|
def getint(self, key):
|
||||||
try:
|
try:
|
||||||
(value, typ) = QueryValueEx(self.hkey, key)
|
(value, typ) = QueryValueEx(self.hkey, key)
|
||||||
|
if typ != REG_DWORD:
|
||||||
|
raise ValueError()
|
||||||
|
return value
|
||||||
except:
|
except:
|
||||||
return None
|
return 0
|
||||||
if typ != REG_DWORD:
|
|
||||||
return None
|
|
||||||
return value
|
|
||||||
|
|
||||||
def set(self, key, val):
|
def set(self, key, val):
|
||||||
if isinstance(val, str):
|
if isinstance(val, str):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user