mirror of https://github.com/MISP/PyMISP
Re-enable python2 support...
parent
78488db7aa
commit
0c66d80dd1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue