oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging.
The imp module is removed in 3.12 and causes an error when loading xxxswf. The recommended replacement is importlib but here the use of imp is actually redundant. When yara isn't found the import yara statement already throws an ImportError for 3.5 and earlier, and for 3.6 and later it throws a ModuleNotFoundError which is a subclass of ImportError and is caught by the same try catch.
The imp module is removed in 3.12 and causes an error when loading
xxxswf
. The recommended replacement isimportlib
but here the use of imp is actually redundant. Whenyara
isn't found theimport yara
statement already throws anImportError
for 3.5 and earlier, and for 3.6 and later it throws aModuleNotFoundError
which is a subclass ofImportError
and is caught by the same try catch.