mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 13:56:47 +00:00
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):
|
def set(self, key, value):
|
||||||
"""Set the 'key' with 'value'."""
|
"""Set the 'key' with 'value'."""
|
||||||
# Sets the "key" with "value" in the config dict
|
# 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)
|
oldtype, newtype = type(self.config[key]), type(value)
|
||||||
if oldtype != newtype:
|
|
||||||
|
if value is not None and oldtype != newtype:
|
||||||
try:
|
try:
|
||||||
value = oldtype(value)
|
value = oldtype(value)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user