Avoid "'NoneType' object is not iterable" Exception in Python 2.7.5

This bug was introduced by #2181