diff options
Diffstat (limited to 'github3/helpers.py')
-rw-r--r-- | github3/helpers.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/github3/helpers.py b/github3/helpers.py index 391fe1e..91b4be5 100644 --- a/github3/helpers.py +++ b/github3/helpers.py @@ -58,16 +58,18 @@ def to_python(obj, if int_keys: for in_key in int_keys: - 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): + obj.__dict__[in_key] = int(in_dict.get(in_key)) if bool_keys: for in_key in bool_keys: - obj.__dict__[in_key] = bool(in_dict.get(in_key)) + if in_dict.get(in_key) is not None: + obj.__dict__[in_key] = bool(in_dict.get(in_key)) if object_map: - for (k, v) in object_map.items(): - obj.__dict__[k] = v.new_from_dict(in_dict.get(k)) + if in_dict.get(k): + obj.__dict__[k] = v.new_from_dict(in_dict.get(k)) obj.__dict__.update(kwargs) |