From 0c66d80dd1e71fd25493c8893db951415f227d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sat, 22 Jul 2017 22:22:39 +0200 Subject: [PATCH] Re-enable python2 support... --- pymisp/tools/objectgenerator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pymisp/tools/objectgenerator.py b/pymisp/tools/objectgenerator.py index c0a7c63..c113304 100644 --- a/pymisp/tools/objectgenerator.py +++ b/pymisp/tools/objectgenerator.py @@ -7,6 +7,7 @@ import json import uuid import abc import sys +import six class MISPObjectException(Exception): @@ -18,7 +19,14 @@ class InvalidMISPObject(MISPObjectException): pass -class MISPObjectGenerator(metaclass=abc.ABCMeta): +if six.PY2: + import warnings + warnings.warn("You're using python 2, it is strongly recommended to use python >=3.4") + + +@six.add_metaclass(abc.ABCMeta) # Remove that line when discarding python2 support. +# Python3 way: class MISPObjectGenerator(metaclass=abc.ABCMeta): +class MISPObjectGenerator(): def __init__(self, template_dir): """This class is used to fill a new MISP object with the default values defined in the object template