fix: Compatibility with python 3.8

pull/1143/head
Raphaël Vinot 2024-01-30 13:27:59 +01:00
parent 298e2f9035
commit f3e17b38dd
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ class MISPEncode(JSONEncoder):
return JSONEncoder.default(self, obj)
class AbstractMISP(MutableMapping[str, Any], MISPFileCache, metaclass=ABCMeta):
class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta): # type: ignore[type-arg]
__resources_path = resources_path
__misp_objects_path = misp_objects_path
__describe_types = describe_types

View File

@ -92,7 +92,7 @@ class TestMISPEvent(unittest.TestCase):
self.assertEqual(self.mispevent.to_json(sort_keys=True, indent=2), json.dumps(ref_json, sort_keys=True, indent=2))
# Fake setting an attribute ID for testing
self.mispevent.attributes[0].id = 42
self.mispevent.delete_attribute(42)
self.mispevent.delete_attribute('42')
with open('tests/mispevent_testfiles/attribute_del.json') as f:
ref_json = json.load(f)
self.assertEqual(self.mispevent.to_json(sort_keys=True, indent=2), json.dumps(ref_json, sort_keys=True, indent=2))