We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd51335 commit 513eb3cCopy full SHA for 513eb3c
github3/helpers.py
@@ -58,16 +58,18 @@ def to_python(obj,
58
59
if int_keys:
60
for in_key in int_keys:
61
- obj.__dict__[in_key] = int(in_dict.get(in_key))
+ if (in_dict is not None) and (in_dict.get(in_key) is not None):
62
+ obj.__dict__[in_key] = int(in_dict.get(in_key))
63
64
if bool_keys:
65
for in_key in bool_keys:
- obj.__dict__[in_key] = bool(in_dict.get(in_key))
66
+ if in_dict.get(in_key) is not None:
67
+ obj.__dict__[in_key] = bool(in_dict.get(in_key))
68
69
if object_map:
-
70
for (k, v) in object_map.items():
- obj.__dict__[k] = v.new_from_dict(in_dict.get(k))
71
+ if in_dict.get(k):
72
+ obj.__dict__[k] = v.new_from_dict(in_dict.get(k))
73
74
obj.__dict__.update(kwargs)
75
0 commit comments