fix: Do not fail on PyMISP import when mail-parser is not present

pull/665/head
Raphaël Vinot 2020-11-24 14:56:29 +01:00
parent 7b2e78246a
commit 9046b08a3c
1 changed files with 2 additions and 4 deletions

View File

@ -28,14 +28,12 @@ class MISPMailObjectOutlookException(InvalidMISPObject):
pass
if not mailparser:
raise MISPMailObjectOutlookException('mail-parser is required to use this module, you can install it by running pip3 install pymisp[email]')
class EMailObject(AbstractMISPObjectGenerator):
def __init__(self, filepath: Union[Path, str] = None, pseudofile: BytesIO = None,
attach_original_email: bool = True, **kwargs):
super().__init__("email", **kwargs)
if not mailparser:
raise MISPMailObjectOutlookException('mail-parser is required to use this module, you can install it by running pip3 install pymisp[email]')
converted = False
if filepath: