Merge pull request #1468 from croneter/fix-dict

Fix Alexa and RuntimeError: dictionary keys changed during iteration
This commit is contained in:
croneter 2021-05-14 08:51:41 +02:00 committed by GitHub
commit a0a6ef00ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ def convert_alexa_to_companion(dictionary):
""" """
The params passed by Alexa must first be converted to Companion talk The params passed by Alexa must first be converted to Companion talk
""" """
for key in dictionary: for key in list(dictionary):
if key in v.ALEXA_TO_COMPANION: if key in v.ALEXA_TO_COMPANION:
dictionary[v.ALEXA_TO_COMPANION[key]] = dictionary[key] dictionary[v.ALEXA_TO_COMPANION[key]] = dictionary[key]
del dictionary[key] del dictionary[key]