Python 2.6 fix

Inline for loop not allowed