mirror of
https://git.deluge-torrent.org/deluge
synced 2025-09-01 15:45:31 +00:00
Fix setting None for config value
This commit is contained in:
parent
bc64bed102
commit
c4d620f0b9
1 changed files with 24 additions and 21 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue