fix: move __not_jsonable *inside* the __init__

Turns out, if you modify a variable defined outside the __init__,
every instances (and inherited classes) of that class will be impacted by it.
pull/434/head
Raphaël Vinot 2019-08-07 16:09:56 +02:00
parent a3140f3773
commit da6d7cbeb8
1 changed files with 1 additions and 2 deletions

View File

@ -82,12 +82,11 @@ class MISPEncode(JSONEncoder):
class AbstractMISP(MutableMapping):
__not_jsonable = []
def __init__(self, **kwargs):
"""Abstract class for all the MISP objects"""
super(AbstractMISP, self).__init__()
self.__edited = True # As we create a new object, we assume it is edited
self.__not_jsonable = []
if kwargs.get('force_timestamps') is not None:
# Ignore the edited objects and keep the timestamps.