Commit 9dc433b8 authored by Romain Bignon's avatar Romain Bignon

BaseObject: prevent casting id from None to 'None' in constructor

It happens for example in weboob.capabilities.account.Account which
gives None as default value.
parent d47b4e03
Pipeline #2108 passed with stages
in 17 minutes and 38 seconds
......@@ -419,7 +419,7 @@ class BaseObject(with_metaclass(_BaseObjectMeta, StrConv, object)):
_fields = None
def __init__(self, id=u'', url=NotLoaded, backend=None):
self.id = to_unicode(id)
self.id = to_unicode(id) if id is not None else u''
self.backend = backend
self._fields = deepcopy(self._fields)
self.__setattr__('url', url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment