diff --git a/pymisp/api.py b/pymisp/api.py index ecbd62d..8f898d5 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -18,7 +18,7 @@ try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin - warnings.warn("You're using python 2, it is strongly recommended to use python >=3.4") + warnings.warn("You're using python 2, it is strongly recommended to use python >=3.5") from io import BytesIO, open import zipfile diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 2bbbe3f..61c3b27 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -43,7 +43,7 @@ from .exceptions import PyMISPError, NewEventError, NewAttributeError try: basestring unicode - warnings.warn("You're using python 2, it is strongly recommended to use python >=3.4") + warnings.warn("You're using python 2, it is strongly recommended to use python >=3.5") except NameError: basestring = str unicode = str diff --git a/pymisp/tools/objectgenerator.py b/pymisp/tools/objectgenerator.py index 970c877..72b5ba0 100644 --- a/pymisp/tools/objectgenerator.py +++ b/pymisp/tools/objectgenerator.py @@ -21,7 +21,7 @@ class InvalidMISPObject(MISPObjectException): if six.PY2: import warnings - warnings.warn("You're using python 2, it is strongly recommended to use python >=3.4") + warnings.warn("You're using python 2, it is strongly recommended to use python >=3.5") class MISPObjectReference(AbstractMISP): @@ -80,7 +80,14 @@ class MISPObjectGenerator(AbstractMISP): if attribute.value is None: continue # Finalize the actual MISP Object - new_object['Attribute'].append({'object_relation': object_type, **attribute._json()}) + # FIXME: This only works on python >= 3.5 + # new_object['Attribute'].append({'object_relation': object_type, **attribute._json()}) + # ### BEGIN #### + # Because we still need to support old python. + temp_attribute = {'object_relation': object_type} + temp_attribute.update(attribute._json()) + new_object['Attribute'].append(temp_attribute) + # ### END #### return new_object, [r.to_dict() for r in self.references] def _validate(self):