`if isinstance(expr, bool)` was added here and in two more places as a dirty fix to `test_issue_3164()`.
A better fix must be found.