Revision 4c14965f
ID | 4c14965fff7abfa451170d9448ae53b34c422d5d |
ConfigObject.ToDict() only export non-None values
The method is changed to a normal loop, to avoid calling getattr()
twice. Also getstate is changed to just use ToDict() by default.
This should also make getstate work for objects which have to
override the ToDict function because they contain other objects.
setstate is probably still broken in this case, but so it was
before, and it's not used inside our code, so I'll pretend not to have
noticed, as there is no "nice" way to fix it, without overriding it all
over the place :(
Some unittests are added as a bonus, to make sure we behave well.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Files
- added
- modified
- copied
- renamed
- deleted