Can't you do a 

```python
if ident is None:
    continue
```

and drop an indentation level for the rest of the loop?