From 1a381a0e3ba860031b0edfa32cf0d02c6fe1af0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 22 Jan 2019 14:59:55 +0100 Subject: [PATCH] fix: Wrong variable name in MISPEvent --- pymisp/mispevent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 53a80fe..6401512 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -374,16 +374,16 @@ class MISPEvent(AbstractMISP): self.__json_schema = json.load(f) if describe_types: # This variable is used in add_attribute in order to avoid duplicating the structure - self.describe_types = describe_types + self._describe_types = describe_types else: with open(os.path.join(ressources_path, 'describeTypes.json'), 'rb') as f: if OLD_PY3: t = json.loads(f.read().decode()) else: t = json.load(f) - self.describe_types = t['result'] + self._describe_types = t['result'] - self._types = self.describe_types['types'] + self._types = self._describe_types['types'] self.Attribute = [] self.Object = [] self.RelatedEvent = [] @@ -654,7 +654,7 @@ class MISPEvent(AbstractMISP): if isinstance(value, list): attr_list = [self.add_attribute(type=type, value=a, **kwargs) for a in value] else: - attribute = MISPAttribute(describe_types=self.describe_types) + attribute = MISPAttribute(describe_types=self._describe_types) attribute.from_dict(type=type, value=value, **kwargs) self.attributes.append(attribute) self.edited = True