@conf
def find_python_module(ctx, module_name, condition='', **kwargs):
    
    ctx.load('hwaf-base', tooldir=_heptooldir)

    if not ctx.env.CXX and not ctx.env.CC:
        msg.fatal('load a C or C++ compiler first')
        pass

    if not ctx.env.HWAF_FOUND_PYTHON:
        ctx.find_python()
        pass

    found = False
    os_env = dict(os.environ)
    try:
        ctx.env.stash()
        env = ctx._get_env_for_subproc()
        for k,v in env.items():
            os.environ[k] = v
            pass
        ctx.check_python_module(module_name, condition)
        found = True
    except ctx.errors.ConfigurationError:
        os.environ = os_env
        ctx.env.revert()
        found = False
        pass
    finally:
        os.environ = os_env
        pass

    if not found and kwargs.get('mandatory', True):
        ctx.fatal(module_name % "python module %s not found")
    return
dataset/ETHPy150Open hwaf/hwaf/py-hwaftools/find_python.py/find_python_module/swapped operands of `%`