Fix incorrect use of list comprehension

- Don't use list comprehension only for the side effects, instead
  use a normal for loop

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>