This should be:
```python
if self._imap_service is not None:
```
> [...] Also, beware of writing if x when you really mean if x is not None [...]
http://www.python.org/dev/peps/pep-0008/