From cb6070e213ec22e10b6fc095324e15296fce95bb Mon Sep 17 00:00:00 2001 From: freiburgermsu Date: Wed, 17 Aug 2022 20:44:49 -0400 Subject: [PATCH] permit empty copies --- cobrakbase/core/kbaseobject.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cobrakbase/core/kbaseobject.py b/cobrakbase/core/kbaseobject.py index a9d5712..63ddf82 100755 --- a/cobrakbase/core/kbaseobject.py +++ b/cobrakbase/core/kbaseobject.py @@ -29,6 +29,7 @@ def __init__(self, data=None, info=None, args=None, kbase_type=None, exclude_dic :param exclude_dict: """ #If an object has a key "data", we need to replace it befor setting attributes to the data + data = data or {} if "data" in data: data["_data"] = data["data"] del(data["data"]) @@ -39,8 +40,6 @@ def __init__(self, data=None, info=None, args=None, kbase_type=None, exclude_dic # Turning all fields in the dictionary into attributes if args is None: args = {} - if data is None: - data = {} self.__dict__ = data self.exclude_dict = set() if exclude_dict: