Fix setting None for config value
This commit is contained in:
parent
bc64bed102
commit
c4d620f0b9
|
@ -113,9 +113,12 @@ class Config:
|
|||
def set(self, key, value):
|
||||
"""Set the 'key' with 'value'."""
|
||||
# Sets the "key" with "value" in the config dict
|
||||
if self.config[key] != value:
|
||||
if self.config[key] == value:
|
||||
return
|
||||
|
||||
oldtype, newtype = type(self.config[key]), type(value)
|
||||
if oldtype != newtype:
|
||||
|
||||
if value is not None and oldtype != newtype:
|
||||
try:
|
||||
value = oldtype(value)
|
||||
except ValueError:
|
||||
|
|
Loading…
Reference in New Issue