Python warning for empty loop