replace by `if not ...: raise ...` ?