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:
parent
cf5c1e0bbc
commit
2ed09c75fd
14
config.py
14
config.py
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user