fix: Correct FileObject import

The FileObject import has been moved outside the try-except-block
related to lief, as the import is needed regardless whether lief
is available or not.
pull/1162/head
Johannes Bader 2024-02-27 16:38:19 +01:00
parent 313ad776c4
commit cb3b655463
1 changed files with 1 additions and 2 deletions

View File

@ -8,6 +8,7 @@ from io import BytesIO
from typing import Any, TYPE_CHECKING from typing import Any, TYPE_CHECKING
from ..exceptions import MISPObjectException from ..exceptions import MISPObjectException
from . import FileObject
logger = logging.getLogger('pymisp') logger = logging.getLogger('pymisp')
try: try:
@ -19,8 +20,6 @@ try:
from .peobject import make_pe_objects from .peobject import make_pe_objects
from .elfobject import make_elf_objects from .elfobject import make_elf_objects
from .machoobject import make_macho_objects from .machoobject import make_macho_objects
from . import FileObject
except AttributeError: except AttributeError:
HAS_LIEF = False HAS_LIEF = False
logger.critical('You need lief >= 0.11.0. The quick and dirty fix is: pip3 install --force pymisp[fileobjects]') logger.critical('You need lief >= 0.11.0. The quick and dirty fix is: pip3 install --force pymisp[fileobjects]')