Why not just
```
elif len(domain) == 0:
```
?