diff --git a/miasm/ir/translators/z3_ir.py b/miasm/ir/translators/z3_ir.py index 4b674c4e3..c72ff36f1 100644 --- a/miasm/ir/translators/z3_ir.py +++ b/miasm/ir/translators/z3_ir.py @@ -1,10 +1,11 @@ from builtins import map from builtins import range -import imp +import importlib.util import logging # Raise an ImportError if z3 is not available WITHOUT actually importing it -imp.find_module("z3") +if importlib.util.find_spec("z3") is None: + raise ImportError("No module named 'z3'") from miasm.ir.translators.translator import Translator