From 0bbfac6143df79de4758a1677c3d1cad77ee15dc Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 29 Jun 2020 18:30:00 +0200 Subject: [PATCH] new: Add AbstractMISP._remove_from_not_jsonable --- pymisp/abstract.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pymisp/abstract.py b/pymisp/abstract.py index 057dd4b..92fcb7f 100644 --- a/pymisp/abstract.py +++ b/pymisp/abstract.py @@ -170,6 +170,14 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta): """Set __not_jsonable to a new list""" self.__not_jsonable = args + def _remove_from_not_jsonable(self, *args) -> None: + """Remove the entries that are in the __not_jsonable list""" + for entry in args: + try: + self.__not_jsonable.remove(entry) + except ValueError: + pass + def from_json(self, json_string: str) -> None: """Load a JSON string""" self.from_dict(**loads(json_string))