Maybe better as
```
    if cond.dtype.type is not np.bool_:
        ...
```