Skip to content

Commit

Permalink
Iterate over a copy of items in ActionAPI.__call__. (#247)
Browse files Browse the repository at this point in the history
This fixes issue #246. Previously, this buggy code in python 3,
due to it modifying keys of a dictionary being iterated over.
  • Loading branch information
jhobbs authored Oct 8, 2020
1 parent 069e758 commit bc1d76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion maas/client/bones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ async def __call__(self, **data):
del data[key]
for nested_key, nested_value in value.items():
data[key + "_" + nested_key] = nested_value
for key, value in data.items():
for key, value in data.copy().items():
if key.startswith("_"):
data[key[1:]] = data.pop(key)
response = await self.bind(**params).call(**data)
Expand Down

0 comments on commit bc1d76a

Please sign in to comment.