This is because in Python 3 getting the keys() of a Dict returns a dict_keys object instead of a list. Change this:
targets.keys()
to this:
list(targets.keys())
This is because in Python 3 getting the keys() of a Dict returns a dict_keys object instead of a list. Change this:
targets.keys()
to this:
list(targets. keys())