Skip to content

Commit bc1d76a

Browse files
authored
Iterate over a copy of items in ActionAPI.__call__. (#247)
This fixes issue #246. Previously, this buggy code in python 3, due to it modifying keys of a dictionary being iterated over.
1 parent 069e758 commit bc1d76a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

maas/client/bones/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ async def __call__(self, **data):
301301
del data[key]
302302
for nested_key, nested_value in value.items():
303303
data[key + "_" + nested_key] = nested_value
304-
for key, value in data.items():
304+
for key, value in data.copy().items():
305305
if key.startswith("_"):
306306
data[key[1:]] = data.pop(key)
307307
response = await self.bind(**params).call(**data)

0 commit comments

Comments
 (0)