Skip to content

Commit

Permalink
JSON Config: Convert float to int (bug 1590)
Browse files Browse the repository at this point in the history
If th
  • Loading branch information
thp committed Apr 29, 2012
1 parent 8973c1e commit 8805b0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gpodder/jsonconfig.py
Expand Up @@ -164,6 +164,11 @@ def _merge_keys(self, merge_source):
elif isinstance(value, dict):
# Recurse into sub-dictionaries
work_queue.append((data[key], value))
elif type(value) != type(data[key]):
# Type mismatch of current value and default
if type(value) == int and type(data[key]) == float:
# Convert float to int if default value is int
data[key] = int(data[key])

return added_new_key

Expand Down

0 comments on commit 8805b0d

Please sign in to comment.