This is trying to modify the set of dictionary keys while lopping over it, which Python3 doesn't seem to allow.
cc @ewelina @zmarshal